|
@@ -335,18 +335,20 @@ export default {
|
|
|
for (let i = 0; i < arrs.length; i++) {
|
|
|
this.optObj[arrs[i].split('=')[0]] = arrs[i].split('=')[1]
|
|
|
}
|
|
|
- console.log('optObj:', this.optObj);
|
|
|
+ console.log('获取的optObj:', this.optObj);
|
|
|
uni.setStorageSync('h5_code', this.optObj.code)
|
|
|
+ // this.OfficialLogin()
|
|
|
} else {
|
|
|
- // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,这时候你就拿到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://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'))
|