فهرست منبع

客户项目鉴权问题

MaiXinRong 2 سال پیش
والد
کامیت
ad185d124d
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      app/lib/tender_info.js
  2. 2 2
      app/service/stage.js

+ 1 - 1
app/lib/tender_info.js

@@ -35,7 +35,7 @@ class TenderInfo {
         if (this.stage) return;
         this.stages = await this._getValidStages(this.tender.id);
         this.stage = this.stages[0];
-        if (this.stage) await this.ctx.service.stage.doCheckStage(this.stage);
+        if (this.stage) await this.ctx.service.stage.doCheckStage(this.stage, this.ctx.session.sessionUser.is_admin);
     }
 
     async _getStageBillsData () {

+ 2 - 2
app/service/stage.js

@@ -137,14 +137,14 @@ module.exports = app => {
             }
             if (stage.users.indexOf(accountId) >= 0) {
                 stage.filePermission = true;
+            } else if (!!isTenderTourist || force) {
+                stage.filePermission = this.tender && this.tender.touristPermission ? this.tender.touristPermission.file : false;
             } else {
                 if (shareIds.indexOf(accountId) !== -1 || (permission !== null && permission.tender !== undefined && permission.tender.indexOf('2') !== -1)) {// 分享人
                     if (stage.status === status.uncheck) {
                         throw '您无权查看该数据';
                     }
                     stage.filePermission = false;
-                } else if (!!isTenderTourist || force) {
-                    stage.filePermission = this.tender && this.tender.touristPermission ? this.tender.touristPermission.file : false;
                 } else {
                     throw '您无权查看该数据';
                 }