Browse Source

app.globalData.user = {
userId: data.userId,
userName: data.userName,
userPhone: data.userPhone
}

姜永辉 1 year ago
parent
commit
4be6d1fb4e
1 changed files with 8 additions and 6 deletions
  1. 8 6
      pages/welcome/welcome.js

+ 8 - 6
pages/welcome/welcome.js

@@ -135,19 +135,21 @@ Page({
 
                 // 记录登录的缓存
                 app.globalData.company = data.company
+                
+                app.globalData.user = {
+                    userId: data.userId,
+                    userName: data.userName,
+                    userPhone: data.userPhone
+                }
 
                 // 说明注册未支付
-                if (!data.company.license) {
+                if (data.company && !data.company.license) {
                     // 成功后跳转支付
                     _this.toPay(res.data.data);
                     return
                 }
 
-                app.globalData.user = {
-                    userId: data.userId,
-                    userName: data.userName,
-                    userPhone: data.userPhone
-                }
+                
                 app.globalData.token = res.data.data.accessToken
                 // 读取后台设置的url
                 if (data.company && data.company.svcIp && data.company.svcPort) {