xingzai преди 1 година
родител
ревизия
b0b330e695
променени са 2 файла, в които са добавени 11 реда и са изтрити 2 реда
  1. 10 2
      controllers/article.go
  2. 1 0
      controllers/user.go

+ 10 - 2
controllers/article.go

@@ -160,9 +160,9 @@ func (this *ArticleNoLoginController) Detail() {
 		detail.Abstract, _ = services.GetReportContentTextSub(detail.Abstract)
 		if companyPermission == "" {
 			if applyCount > 0 {
-				hasPermission = 6
-			} else {
 				hasPermission = 2
+			} else {
+				hasPermission = 3
 			}
 			hasFree = 2
 			goto Loop
@@ -322,6 +322,14 @@ Loop:
 	if user.UserId == 0 {
 		hasPermission = 1
 	}
+	if hasPermission != 1 {
+		hasPermission, err = services.GetUserPermissionCode(user.UserId, user.CompanyId)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取用户状态信息失败,Err:" + err.Error()
+			return
+		}
+	}
 	resp.HasPermission = hasPermission
 	resp.IsSpecialArticle = detail.IsSpecialArticle
 	resp.Detail = detail

+ 1 - 0
controllers/user.go

@@ -204,6 +204,7 @@ func (this *UserController) Detail() {
 				resp.PermissionStatus = userYanxunaDetail.Status
 				resp.StartDate = userYanxunaDetail.StartDate
 				resp.EndDate = userYanxunaDetail.EndDate
+				hasPermission = 1
 				//resp.PermissionName = utils.CHART_PERMISSION_NAME_MF_YANXUAN
 			} else {