|
@@ -1,5 +1,5 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="fle bgColor" v-if="!isSSo && false">
|
|
2
|
+ <div class="fle bgColor" v-if="!isSSo">
|
3
|
3
|
<load-ing v-show="requesterLgoinType == 'wechat'"></load-ing>
|
4
|
4
|
<h2
|
5
|
5
|
v-if="requesterLgoinType == 'web'"
|
|
@@ -123,10 +123,20 @@ export default {
|
123
|
123
|
zlogin() {
|
124
|
124
|
console.log(this);
|
125
|
125
|
var that = this;
|
|
126
|
+ var ssoStr = "";
|
|
127
|
+ var ssoJson;
|
|
128
|
+ if (this.isSSo) {
|
|
129
|
+ ssoStr = location.search
|
|
130
|
+ .replace("?", "")
|
|
131
|
+ .split("&")[0]
|
|
132
|
+ .split("=")[1];
|
|
133
|
+ ssoStr = decode(decodeURIComponent(ssoStr));
|
|
134
|
+ ssoJson = JSON.parse(ssoStr);
|
|
135
|
+ }
|
126
|
136
|
var postData = this.isSSo
|
127
|
|
- ? { type: 'pc' }
|
|
137
|
+ ? { username: ssoJson.a, password: ssoJson.u, t: false }
|
128
|
138
|
: { username: this.zhanghao, password: this.mima };
|
129
|
|
- this.$http.post("/service/auth/sslLogin", postData).then(res => {
|
|
139
|
+ this.$http.post("/service/auth/loginEncrypt", postData).then(res => {
|
130
|
140
|
that.loading = false;
|
131
|
141
|
if (res.data && res.data.state == 200) {
|
132
|
142
|
localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
|
|
@@ -135,10 +145,6 @@ export default {
|
135
|
145
|
JSON.stringify(res.data.data.requester)
|
136
|
146
|
);
|
137
|
147
|
this.getConfig(res.data.data.user,res.data.data.requester);
|
138
|
|
- }else if (res.data && res.data.state == 501) {
|
139
|
|
- var user = JSON.parse(localStorage.getItem('loginUser'));
|
140
|
|
- var requester = JSON.parse(localStorage.getItem('login_requester'));
|
141
|
|
- user && requester && this.getConfig(user,requester);
|
142
|
148
|
} else {
|
143
|
149
|
that
|
144
|
150
|
.$createDialog({
|
|
@@ -227,7 +233,11 @@ export default {
|
227
|
233
|
}
|
228
|
234
|
},
|
229
|
235
|
created() {
|
230
|
|
- this.isSSo = true;
|
|
236
|
+ if (location.search.length > 0) {
|
|
237
|
+ this.isSSo = Boolean(this.getQueryString("t"));
|
|
238
|
+ } else {
|
|
239
|
+ this.isSSo = false;
|
|
240
|
+ }
|
231
|
241
|
if (this.isSSo) {
|
232
|
242
|
this.zlogin();
|
233
|
243
|
}
|