Parcourir la source

feat 管理端登录页面添加租户id

wzh il y a 4 mois
Parent
commit
ae3532c6dc
1 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. 8 3
      pages/hexiao/login.vue

+ 8 - 3
pages/hexiao/login.vue

@@ -70,6 +70,7 @@ export default {
       countdown: 60,
       timer: null,
       imgurl:"https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu",
+      tenantId:0,
 
     }
   },
@@ -79,7 +80,11 @@ export default {
       this.timer = null;
     }
   },
-  onLoad(){
+  onLoad(opt){
+    if(opt.uid){
+      this.tenantId = opt.uid;
+    }
+
     let token = getAdminToken()
     if(token){
       this.doLoginSuccess();
@@ -128,7 +133,7 @@ export default {
       }
 
       // 调用API
-      getVerificationCode(this.phone,userType).then(res => {
+      getVerificationCode(this.phone,userType,this.tenantId).then(res => {
         if(res.code !== 0){
           uni.showToast({ title: res.msg || '找不到用户信息,请确认', icon: 'none' });
           return;
@@ -184,7 +189,7 @@ export default {
         provider: 'weixin', //使用微信登录
         success: function (loginRes) {
           let jsCode = loginRes.code;
-          login(self.phone, self.code,userType,jsCode).then(res => {
+          login(self.phone, self.code,userType,jsCode,this.tenantId).then(res => {
             // 登录成功 (res.code === 0)
             uni.hideLoading();