diff --git a/src/App.vue b/src/App.vue index 3687a23..00aba70 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,13 +46,16 @@ onMounted(() => { watch( () => wxStore.userid, (newVal) => { - if (newVal && !ab98UserStore.isLogin) { + const isLogin = ab98UserStore.isLogin; + if (newVal) { tokenLogin(ab98UserStore.tokenLogin, newVal, wxStore.openid).then(res => { if (res?.code === 0 && res.data?.success) { ab98UserStore.setTel(res.data.tel) ab98UserStore.setUserInfo(res.data) - ab98UserStore.setIsLogin(true) - router.push('/') + if (!isLogin) { + ab98UserStore.setIsLogin(true) + router.push('/') + } } }) }