diff --git a/App.vue b/App.vue index 7e59931..e388206 100644 --- a/App.vue +++ b/App.vue @@ -46,14 +46,22 @@ store.commit('SETTOKEN', 'Bearer ' + querys.token); } - // 锁粉?后的 - if (querys.spread) { - setTimeout(() => { - spread({ puid: querys.spread, code: 0 }).then(res => { - console.log(res) + setTimeout(() => { + if (uni.getStorageSync('spreadId')) { + console.log(uni.getStorageSync('spreadId')) + spread({ puid: uni.getStorageSync('spreadId'), code: 0 }).then(res => { }) - }, 1000) - }; + } + },2000) + + // 锁粉?后的 + // if (querys.spread) { + // setTimeout(() => { + // spread({ puid: querys.spread, code: 0 }).then(res => { + // console.log(res) + // }) + // }, 1000) + // }; if(Object.keys(querys)['length'] > 0){ if(querys?.para){ @@ -91,7 +99,6 @@ console.log('没有参数') } - alert(this['globalData']['parameters']['spread'], '获取1') this.SETSPREAD(this['globalData']['parameters']['spread']); // 分享者的参数 // if (this['globalData']['parameters']['spread']) { @@ -102,20 +109,21 @@ // }, 1000) // } }else{ - console.log('分享者的参数1997', !querys.token) console.log('登录token后存在的参数1997', querys) - alert(querys.userinfor.spread, '获取2') - // 分享者的参数 - if (querys.userinfor.spread) { - setTimeout(() => { - this.SETSPREAD(querys.userinfor.spread); - spread({ puid: querys.userinfor.spread, code: 0 }).then(res => { + setTimeout(() => { + console.log(querys.userinfor?.spread, '分享人分享人分享人分享人分享人分享人分享人分享人分享人') + if (querys.userinfor?.spread) { + uni.setStorageSync('spreadId', querys.userinfor?.spread) + let spreadId = uni.getStorageSync('spreadId') + spread({ puid: spreadId, code: 0 }).then(res => { }) - }, 1000) - } + } + }, 2000) if (!querys.token) { + querys.query = querys.query.replace(/=/g, '') + console.log(querys) for(let key in querys){ const value = querys[key]; querys[key] = JSON.parse(value); diff --git a/request/request.js b/request/request.js index 81bcf1f..7828624 100644 --- a/request/request.js +++ b/request/request.js @@ -133,8 +133,8 @@ class Request { if (infor['data']['status'] != 200 && infor['data']['code'] != 7777) { // #ifdef H5 if (infor['data']['status'] == 110002 && !isMiniPrograms()) { - // window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/users/h5_login/index?redirectUri=${window.location.protocol + "//" + window.location.host}/privilege/pages/restaurant/home/shop_home/shop_home`; - window.location.href = `http://10.210.254.176:1024/JXH5/#/pages/users/h5_login/index?redirectUri=http://10.210.254.176:8090/privilege/pages/restaurant/home/shop_home/shop_home`; + window.location.href = `${HTTP_REQUEST_URL}/JXH5/pages/users/h5_login/index?redirectUri=${window.location.protocol + "//" + window.location.host}/privilege/pages/restaurant/home/shop_home/shop_home`; + // window.location.href = `http://10.210.254.176:1024/JXH5/#/pages/users/h5_login/index?redirectUri=http://10.210.254.176:8090/privilege/pages/restaurant/home/shop_home/shop_home`; } // #endif if (infor['data']['msg'] == '产品错误' || infor['data']['msg'] == '产品不存在') { diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html index c6d76b0..4690adb 100644 --- a/unpackage/dist/build/web/index.html +++ b/unpackage/dist/build/web/index.html @@ -1,2 +1,2 @@