72 lines
1.8 KiB
Vue
72 lines
1.8 KiB
Vue
|
<template>
|
||
|
<div class="app-content">
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: "build",
|
||
|
data() {
|
||
|
return {
|
||
|
userOpenId:"",
|
||
|
show: true,
|
||
|
dialogVisible: false,
|
||
|
bindPhoneVo: {
|
||
|
openId: '',
|
||
|
phone: ''
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
watch: {},
|
||
|
created() {
|
||
|
this.userOpenId = this.$route.query.userOpenId;
|
||
|
console.log("userOpenId====>",userOpenId);
|
||
|
let qs = this.getQueryString('userOpenId');
|
||
|
console.log("getQueryString====>",qs);
|
||
|
this.wechatLogin();
|
||
|
},
|
||
|
methods: {
|
||
|
wechatLogin() {
|
||
|
// 处理微信授权登录
|
||
|
let openId = this.getQueryString('openId') || '';
|
||
|
// token === '' && openId != '' 只要这种情况,未绑定账号
|
||
|
if(openId != '') {
|
||
|
// 绑定账号
|
||
|
this.bindPhoneVo.openId = openId
|
||
|
this.dialogVisible = false
|
||
|
console.log("dialogVisible===>");
|
||
|
} else {
|
||
|
// 如果绑定了,返回成功
|
||
|
console.log("我要去登录了===>");
|
||
|
let _baseUrl = "https://szgc.jhncidg.com";
|
||
|
window.location = _baseUrl + '/jhapi/wxAuth/authorize?returnUrl=' + _baseUrl + "/#/wxAuth"
|
||
|
}
|
||
|
},
|
||
|
saveBind() {
|
||
|
console.log("saveBind");
|
||
|
},
|
||
|
getQueryString (paramName) {
|
||
|
if(window.location.href.indexOf('?') == -1) return '';
|
||
|
let searchString = window.location.href.split('?')[1];
|
||
|
let i, val, params = searchString.split("&");
|
||
|
for (i=0;i<params.length;i++) {
|
||
|
val = params[i].split("=");
|
||
|
if (val[0] == paramName) {
|
||
|
return val[1];
|
||
|
}
|
||
|
}
|
||
|
return '';
|
||
|
}
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
<style scope>
|
||
|
.app-content {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
background: #191d28
|
||
|
url("https://szgcwx.jhncidg.com/staticFiles/img/CORE_40247DD946964A15AA0D4000E1031E19.png")
|
||
|
no-repeat bottom/100%;
|
||
|
}
|
||
|
</style>
|