Browse Source

fix: 临时客户可查看所有权限

hsun 1 year ago
parent
commit
6a8d402978
1 changed files with 12 additions and 6 deletions
  1. 12 6
      controller/english_report/english_report.go

+ 12 - 6
controller/english_report/english_report.go

@@ -383,13 +383,19 @@ func (er *EnglishReportController) Detail(c *gin.Context) {
 	var authOk bool
 	userInfo := services.GetInfoByClaims(c)
 	if userInfo.Id > 0 {
-		// 报告权限校验
-		ok, e := english_report_service.CheckUserReportAuthByCompanyAndClassify(int(userInfo.CompanyId), reportItem.ClassifyIdSecond)
-		if e != nil {
-			resp.FailMsg("获取失败", "报告权限校验失败, Err: "+e.Error(), c)
-			return
+		// 正式客户, 校验权限
+		if userInfo.Status == 1 {
+			ok, e := english_report_service.CheckUserReportAuthByCompanyAndClassify(int(userInfo.CompanyId), reportItem.ClassifyIdSecond)
+			if e != nil {
+				resp.FailMsg("获取失败", "报告权限校验失败, Err: "+e.Error(), c)
+				return
+			}
+			authOk = ok
+		}
+		// 临时客户, 可查看所有
+		if userInfo.Status == 2 {
+			authOk = true
 		}
-		authOk = ok
 	}
 	content, subContent := ``, ``
 	if authOk {