瀏覽代碼

fix 增加errormsg

wzh 2 天之前
父節點
當前提交
c056a16825
共有 1 個文件被更改,包括 2 次插入3 次删除
  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' });
           });
         }
       });