1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
</template>
<script>
import { Notification } from 'element-ui';
import { getShopInf } from '@/api/module/entry';
import request from '@/utils/request'
export default {
name: "Platformlogin",
data(){
return{
ssourl:''
}
},
created() {
this.getssourl();
},
methods: {
getssourl(){
debugger
var ssa = window.location.host
// var ssa = 'scm.jxhh.com'
let data = {
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.channel_site[0].domain
this.gotosso()
}
})
.catch(() => {
})
},
gotosso() {
var ticket = this.$route.query.ticket;
this.$store.dispatch('Login', {"ticket": ticket}).then((res) => {
debugger
if (res.token != "") {
// 获取客户是否有审核信息
getShopInf().then(res => {
if(res.code === 1) {
switch(res.data.state) {
case 0:
switch(res.data.status){
case(0):
this.$router.push({path: '/process'});
break;
case(1):
this.$router.push({path: '/fillShopInf'});
break;
}
break;
case 1: // 审核成功,要跳转到首页
this.$router.push({path: '/home/index'});
break;
case 2: // 审核中
this.$router.push({path: '/reviewing'});
break;
case 3: // 审核失败
let msg = res.data.Apply.content;
this.$router.push({
name: 'reviewFail',
params: { msg: msg }
});
break;
}
}else {
if(res && res.msg) {
Notification.error({
title: '提示:',
message: res.msg
})
}else {
Notification.error({
title: '提示:',
message: '刷新浏览器后,再次登录,若仍不行,请联系我们!'
})
}
}
});
} else {
this.$store.dispatch('Statistic')
this.$store.dispatch('FedLogOut')
var ssa = window.location.host;
var ht = document.location.protocol
let that = this
setTimeout(function () {
if (ssa == 'localhost:1024') {
window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} else {
window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
}
}, 1000)
}
this.loading = false
})
.catch(() => {
this.$store.dispatch('FedLogOut')
var ssa = window.location.host
var ht = document.location.protocol
let that = this
setTimeout(function () {
if (ssa == 'localhost:1024') {
window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
} else {
window.location.href = ht+'//'+that.ssourl+'/api/v2/logout?redirect='+ht+'//' + ssa + '/login'
}
}, 1000)
this.loading = false
})
},
}
};
</script>