ServiceKQ.vue
1.47 KB
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
<template>
<service-basekq :centerNo="centerNo" v-if="centerNo"></service-basekq>
</template>
<script>
import ServiceBasekq from './ServiceBaseKQ.vue'
export default {
name: 'ServiceKQ',
data () {
return {
centerNo: '',
}
},
mounted () {
console.log('xst mounted')
this.checkAuth()
},
activated () {
console.log('KQ activated')
this.checkAuth()
},
methods: {
checkAuth () {
let centerNo = this.$route.query.center_no || sessionStorage.getItem('centerNo');
if (centerNo) {
alert('获取到centerNo,不跳登录')
console.log('获取到centerNo,不跳登录')
this.centerNo = centerNo
sessionStorage.setItem('centerNo', centerNo);
} else {
const sUserAgent = window.navigator.userAgent.toLowerCase()
const dtdreamweb = sUserAgent.indexOf("dtdreamweb") > -1
const miniprogram = sUserAgent.indexOf("miniprogram") > -1 && sUserAgent.indexOf("alipay") > -1
if (dtdreamweb) {
alert('浙里办')
window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=hswsy`;
}
else if (miniprogram) {
alert('支付宝')
// window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=passp&goto=`;
}
else{
alert('非浙里办或支付宝渠道访问')
}
}
},
},
components: {
ServiceBasekq
}
}
</script>