|
@@ -415,6 +415,7 @@ export default {
|
|
subjectList: [],
|
|
subjectList: [],
|
|
subIndex: 0,
|
|
subIndex: 0,
|
|
courSubjectId: "",
|
|
courSubjectId: "",
|
|
|
|
+ optObj: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async onLoad(option) {
|
|
async onLoad(option) {
|
|
@@ -446,6 +447,7 @@ export default {
|
|
async onShow() {
|
|
async onShow() {
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
if (location.search) {
|
|
if (location.search) {
|
|
|
|
+ console.log('url值:', location.search)
|
|
let arrs = location.search.slice(1).split("&")
|
|
let arrs = location.search.slice(1).split("&")
|
|
for (let i = 0; i < arrs.length; i++) {
|
|
for (let i = 0; i < arrs.length; i++) {
|
|
this.optObj[arrs[i].split('=')[0]] = arrs[i].split('=')[1]
|
|
this.optObj[arrs[i].split('=')[0]] = arrs[i].split('=')[1]
|
|
@@ -454,15 +456,15 @@ export default {
|
|
uni.setStorageSync('h5_code', this.optObj.code)
|
|
uni.setStorageSync('h5_code', this.optObj.code)
|
|
this.OfficialLogin()
|
|
this.OfficialLogin()
|
|
} else {
|
|
} else {
|
|
- console.log('没有code');
|
|
|
|
|
|
+ console.log('没有code')
|
|
// 没有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')) {
|
|
|
|
- // location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
|
|
|
|
- // return
|
|
|
|
- // } else {
|
|
|
|
- // // this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
|
|
|
|
- // // this.OfficialLogin()
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!uni.getStorageSync('h5_code')) {
|
|
|
|
+ location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ // this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
|
|
|
|
+ // this.OfficialLogin()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// #endif
|
|
// #endif
|
|
this.getInfo(); // 判断有没有关注公众号
|
|
this.getInfo(); // 判断有没有关注公众号
|