Ver código fonte

fix 增加errormsg

wzh 2 dias atrás
pai
commit
c056a16825
1 arquivos alterados com 2 adições e 3 exclusões
  1. 2 3
      pages/hexiao/login.vue

+ 2 - 3
pages/hexiao/login.vue

@@ -265,20 +265,19 @@ export default {
           login(self.phone, self.code,userType,jsCode,this.tenantId).then(res => {
             // 登录成功 (res.code === 0)
             uni.hideLoading();
-
             if (res.code === 0) {
               setAdminToken(res.data.sessionId)
               self.setUserInfo(res.data);
               self.doLoginSuccess();
             } else {
               console.log('登录失败!' + res.msg);
-              uni.showToast({ title: err.msg || '登录失败', icon: 'none' });
+              uni.showToast({ title: res.msg || '登录失败', icon: 'none' });
             }
           }).catch(err => {
             // 登录失败 (res.code !== 0 或网络错误)
             uni.hideLoading();
             console.error('登录失败:', err);
-            uni.showToast({ title: err.msg || '登录失败', icon: 'none' });
+            uni.showToast({ title: res.msg || '登录失败', icon: 'none' });
           });
         }
       });