6
0
Fork 0
hui.zhou
h30830569 2022-06-06 17:31:08 +08:00
parent 17646d19b0
commit 5362a7dd21
2 changed files with 7 additions and 3 deletions

View File

@ -15,7 +15,7 @@ export default {
this.$store.dispatch('app/getArticle');
/* #ifdef MP-WEIXIN */
wxMnpLogin()
// wxMnpLogin()
/* #endif */
// #ifdef APP-PLUS
@ -28,10 +28,13 @@ export default {
// checkUpdate();
// #endif
},
onShow: function (option) {
onShow(option) {
console.log(option);
let invite_code = option.query.invite_code || strToParams(decodeURIComponent(option.query.scene)).invite_code
uni.setStorageSync('INVITE_CODE',invite_code)
/* #ifdef MP-WEIXIN */
wxMnpLogin()
/* #endif */
},
onHide: function () {
console.log('App Hide');

View File

@ -22,7 +22,8 @@ export function getWxCode() {
export async function wxMnpLogin(){
store.commit('user/LOGOUT')
const code = await getWxCode()
await silentLogin({code})
const invite_code= uni.getStorageSync('INVITE_CODE')||null
await silentLogin({code,invite_code})
}