|
@@ -123,20 +123,10 @@ 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
|
|
- }
|
136
|
126
|
var postData = this.isSSo
|
137
|
|
- ? { username: ssoJson.a, password: ssoJson.u, t: false }
|
|
127
|
+ ? { type: 'pc' }
|
138
|
128
|
: { username: this.zhanghao, password: this.mima };
|
139
|
|
- this.$http.post("/service/auth/loginEncrypt", postData).then(res => {
|
|
129
|
+ this.$http.post("/service/auth/sslLogin", postData).then(res => {
|
140
|
130
|
that.loading = false;
|
141
|
131
|
if (res.data && res.data.state == 200) {
|
142
|
132
|
localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
|
|
@@ -145,6 +135,10 @@ export default {
|
145
|
135
|
JSON.stringify(res.data.data.requester)
|
146
|
136
|
);
|
147
|
137
|
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);
|
148
|
142
|
} else {
|
149
|
143
|
that
|
150
|
144
|
.$createDialog({
|
|
@@ -233,11 +227,7 @@ export default {
|
233
|
227
|
}
|
234
|
228
|
},
|
235
|
229
|
created() {
|
236
|
|
- if (location.search.length > 0) {
|
237
|
|
- this.isSSo = Boolean(this.getQueryString("t"));
|
238
|
|
- } else {
|
239
|
|
- this.isSSo = false;
|
240
|
|
- }
|
|
230
|
+ this.isSSo = true;
|
241
|
231
|
if (this.isSSo) {
|
242
|
232
|
this.zlogin();
|
243
|
233
|
}
|