|
@@ -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'"
|
|
@@ -211,10 +211,20 @@ export default {
|
211
|
211
|
zlogin() {
|
212
|
212
|
console.log(this);
|
213
|
213
|
var that = this;
|
|
214
|
+ var ssoStr = "";
|
|
215
|
+ var ssoJson;
|
|
216
|
+ if (this.isSSo) {
|
|
217
|
+ ssoStr = location.search
|
|
218
|
+ .replace("?", "")
|
|
219
|
+ .split("&")[0]
|
|
220
|
+ .split("=")[1];
|
|
221
|
+ ssoStr = decode(decodeURIComponent(ssoStr));
|
|
222
|
+ ssoJson = JSON.parse(ssoStr);
|
|
223
|
+ }
|
214
|
224
|
var postData = this.isSSo
|
215
|
|
- ? { type: 'pc' }
|
|
225
|
+ ? { username: ssoJson.a, password: ssoJson.u, t: false }
|
216
|
226
|
: { username: this.zhanghao, password: this.mima };
|
217
|
|
- this.$http.post("service/auth/sslLogin", postData).then(res => {
|
|
227
|
+ this.$http.post("service/auth/loginEncrypt", postData).then(res => {
|
218
|
228
|
that.loading = false;
|
219
|
229
|
if (res.data && res.data.state == 200) {
|
220
|
230
|
localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
|
|
@@ -224,10 +234,6 @@ export default {
|
224
|
234
|
JSON.stringify(res.data.data.requester)
|
225
|
235
|
);
|
226
|
236
|
this.getConfig(res.data.data.user,res.data.data.requester);
|
227
|
|
- }else if (res.data && res.data.state == 501) {
|
228
|
|
- var user = JSON.parse(localStorage.getItem('loginUser'));
|
229
|
|
- var requester = JSON.parse(localStorage.getItem('login_requester'));
|
230
|
|
- user && requester && this.getConfig(user,requester);
|
231
|
237
|
} else {
|
232
|
238
|
that
|
233
|
239
|
.$createDialog({
|
|
@@ -252,7 +258,11 @@ export default {
|
252
|
258
|
}
|
253
|
259
|
},
|
254
|
260
|
created() {
|
255
|
|
- this.isSSo = true;
|
|
261
|
+ if (location.search.length > 0) {
|
|
262
|
+ this.isSSo = Boolean(this.getQueryString("t"));
|
|
263
|
+ } else {
|
|
264
|
+ this.isSSo = false;
|
|
265
|
+ }
|
256
|
266
|
if (this.isSSo) {
|
257
|
267
|
this.zlogin();
|
258
|
268
|
}
|