소스 검색

登录导常重启问题

zhangweicheng 6 년 전
부모
커밋
e5b2ab274f
2개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 6 6
      modules/users/models/user_model.js
  2. 4 4
      web/building_saas/main/js/models/installation_fee.js

+ 6 - 6
modules/users/models/user_model.js

@@ -67,10 +67,10 @@ class UserModel extends BaseModel {
                 Request.post(postData, function (err, postResponse, body) {
                     if (err) {
                         console.log('111');
-                        throw '请求错误';
+                        reject('请求错误');
                     }
                     if (postResponse.statusCode !== 200) {
-                        throw '通行证验证失败!';
+                        reject('通行证验证失败!');
                     }
                     resolve(body);
                 });
@@ -103,10 +103,10 @@ class UserModel extends BaseModel {
                 Request.post(postData, function (err, postResponse, body) {
                     if (err) {
                         console.log('111');
-                        throw '请求错误';
+                        reject('请求错误');
                     }
                     if (postResponse.statusCode !== 200) {
-                        throw '通行证验证失败!';
+                        reject('通行证验证失败!');
                     }
                     resolve(body);
                 });
@@ -135,10 +135,10 @@ class UserModel extends BaseModel {
                 Request.post(postData, function (err, postResponse, body) {
                     if (err) {
                         console.log('111');
-                        throw '请求错误';
+                        reject('请求错误');
                     }
                     if (postResponse.statusCode !== 200) {
-                        throw '通行证验证失败!';
+                        reject('通行证验证失败!');
                     }
                     resolve(body);
                 });

+ 4 - 4
web/building_saas/main/js/models/installation_fee.js

@@ -223,6 +223,10 @@ var installation_fee = {
             }
         };
        installation_fee.prototype.calcInstallationFee=function(callback){
+            if(!projectObj.project.isInstall()){//如果不是安装工程,则不用计算
+                if(callback) callback(false);
+                return;
+            }
             let project = projectObj.project,me = this;
             let engineering = projectObj.project.projectInfo.property.engineering;
             let installSetting = projectObj.project.projectInfo.property.installSetting;
@@ -235,10 +239,6 @@ var installation_fee = {
             let FBMap = {};//保存分部下对应的补项
             let usedBXMap = {};//有使用到的补项
             let startTime =  +new Date();
-            if(!projectObj.project.isInstall()){//如果不是安装工程,则不用计算
-                if(callback) callback(false);
-                return;
-            }
             for(let bx of BXs){//把补项放入映射表中
                 FBMap[bx.ParentID] = bx;
             }