|
@@ -337,22 +337,16 @@ export default {
|
|
|
}
|
|
|
console.log('获取的optObj:', this.optObj);
|
|
|
uni.setStorageSync('h5_code', this.optObj.code)
|
|
|
- // this.OfficialLogin()
|
|
|
+ this.OfficialLogin()
|
|
|
} else {
|
|
|
+ console.log('没有code', uni.getStorageSync('h5_code'));
|
|
|
// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,就拿到code了
|
|
|
if (!uni.getStorageSync('h5_code')) {
|
|
|
- console.log('跳转');
|
|
|
- // location.replace(
|
|
|
- // "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6f48f721d18244eb" +
|
|
|
- // "&redirect_uri=" +
|
|
|
- // encodeURIComponent('https://www.xyyxt.net/?ask_type=h.xyyxt.net') +
|
|
|
- // "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
|
|
|
- // )
|
|
|
location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
|
|
|
return
|
|
|
} else {
|
|
|
this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
|
|
|
- // this.OfficialLogin()
|
|
|
+ this.OfficialLogin()
|
|
|
}
|
|
|
}
|
|
|
// #endif
|
|
@@ -439,7 +433,7 @@ export default {
|
|
|
url: '/app/common/gzh_login',
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
- code: this.optObj.code || '011j2t0w3R1oNZ2Vh44w3sgS251j2t0B'
|
|
|
+ code: this.optObj.code
|
|
|
},
|
|
|
noToken: true
|
|
|
}).then((res) => {
|