Selaa lähdekoodia

扫码登录时不需要弹窗提示登录成功

Xiao_123 3 viikkoa sitten
vanhempi
commit
41f81a74db
2 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 1 1
      layout/components/authModal/necessaryInfo/index.vue
  2. 2 1
      store/user.js

+ 1 - 1
layout/components/authModal/necessaryInfo/index.vue

@@ -235,7 +235,7 @@ const submit = async () => {
     // await useUserStore.getUserInfo()
 	
     // 若是扫码登录且账号未注册的,注册后需授权给pc登录
-    if (wxLoginCode)handleWeiXinQrCodeAuthorize()
+    if (wxLoginCode) handleWeiXinQrCodeAuthorize()
   } catch (err) {
     uni.showToast({ title: err?.msg || '保存失败', icon: 'none' })
   }

+ 2 - 1
store/user.js

@@ -55,7 +55,8 @@ export const userStore = defineStore('user', {
       this.phone = query.phone
       const apiList = [weChatLogin, smsLogin, passwordLogin] 
       const { data, code } = await apiList[index](query)
-      if (code === 0) {
+      // 扫码登录不需要弹提示语
+      if (code === 0 && !uni.getStorageSync('wxLoginCode')) {
         uni.showToast({
           title: '登录成功'
         })