浏览代码

Merge branch 'need/cygx_967' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 8 月之前
父节点
当前提交
30cd5c41dd
共有 3 个文件被更改,包括 31 次插入25 次删除
  1. 15 15
      controllers/tag.go
  2. 14 9
      controllers/yanxuan_special.go
  3. 2 1
      utils/constants.go

+ 15 - 15
controllers/tag.go

@@ -32,21 +32,21 @@ func (this *TagController) TagCustomizeList() {
 	var condition string
 	var resp models.CygxTagListResp
 
-	hasPermission, err := services.GetUserHasPermissionSimple(sysUser)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		return
-	}
-	if hasPermission > 1 {
-		list := make([]*models.CygxTagList, 0)
-		resp.List = list
-		br.Ret = 200
-		br.Success = true
-		br.Msg = "获取成功"
-		br.Data = resp
-		return
-	}
+	//hasPermission, err := services.GetUserHasPermissionSimple(sysUser)
+	//if err != nil {
+	//	br.Msg = "获取信息失败"
+	//	br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
+	//	return
+	//}
+	//if hasPermission > 1 {
+	//	list := make([]*models.CygxTagList, 0)
+	//	resp.List = list
+	//	br.Ret = 200
+	//	br.Success = true
+	//	br.Msg = "获取成功"
+	//	br.Data = resp
+	//	return
+	//}
 
 	list, err := models.GetCygxTagList(condition)
 	if err != nil {

+ 14 - 9
controllers/yanxuan_special.go

@@ -163,8 +163,8 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 		this.Data["json"] = br
 		this.ServeJSON()
 	}()
-	sysUser := this.User
-	if sysUser == nil {
+	user := this.User
+	if user == nil {
 		br.Msg = "请登录"
 		br.ErrMsg = "请登录,SysUser Is Empty"
 		br.Ret = 408
@@ -179,7 +179,7 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 		return
 	}
 
-	item, tmpErr := models.GetYanxuanSpecialById(specialId, sysUser.UserId)
+	item, tmpErr := models.GetYanxuanSpecialById(specialId, user.UserId)
 	if tmpErr != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
@@ -236,7 +236,7 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 		br.ErrMsg = "获取失败, Err:" + err.Error()
 		return
 	}
-	if item.UserId != sysUser.UserId && item.Status != 3 && !strings.Contains(cnf.ConfigValue, sysUser.Mobile) {
+	if item.UserId != user.UserId && item.Status != 3 && !strings.Contains(cnf.ConfigValue, user.Mobile) {
 		resp.CygxYanxuanSpecialItem = *new(models.CygxYanxuanSpecialItem) // 如果内容不可见,就把内容置空
 		resp.CygxYanxuanSpecialItem.Status = item.Status
 		//resp.HasPermission = 2
@@ -258,13 +258,13 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 	//判断是否属于审核人员
 	mobileSlice := strings.Split(cnf.ConfigValue, ",")
 	for _, v := range mobileSlice {
-		if v == sysUser.Mobile {
+		if v == user.Mobile {
 			resp.IsApprovalAdmin = true
 		}
 	}
 
-	if sysUser.UserId > 0 {
-		followCount, err := models.GetCygxYanxuanSpecialFollowCountByUser(sysUser.UserId, item.UserId)
+	if user.UserId > 0 {
+		followCount, err := models.GetCygxYanxuanSpecialFollowCountByUser(user.UserId, item.UserId)
 		if err != nil {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取失败, Err:" + err.Error()
@@ -276,17 +276,22 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 	}
 
 	//校验研选专栏权限,以及无权限的时候的对应状态码
-	havePower, err := services.GetYanxuanSpecialDetailUserPower(sysUser)
+	havePower, err := services.GetYanxuanSpecialDetailUserPower(user)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		return
 	}
+	//看自己的文章时不设权限限制,不需要判断是否有研选订阅权限,都可以看。
+	if user.UserId == item.UserId {
+		havePower = true
+	}
+
 	var hasPermission int
 	if havePower {
 		hasPermission = 1
 	} else {
-		hasPermission, err = services.GetUserDetailPermissionCode(sysUser.UserId, sysUser.CompanyId)
+		hasPermission, err = services.GetUserDetailPermissionCode(user.UserId, user.CompanyId)
 		if err != nil {
 			br.Msg = "获取信息失败"
 			br.ErrMsg = "获取用户权限状态失败,Err:" + err.Error()

+ 2 - 1
utils/constants.go

@@ -215,7 +215,8 @@ const (
 )
 
 const (
-	ABOUT_US_URL   = "https://hzstatic.hzinsights.com/static/yb/video/8617330c2a76e0c35999f6466b4470c4.mp4"
+	//ABOUT_US_URL   = "https://hzstatic.hzinsights.com/static/yb/video/8617330c2a76e0c35999f6466b4470c4.mp4"
+	ABOUT_US_URL   = "https://hzstatic.hzinsights.com/cygx_web/config/about.mp4"
 	ABOUT_US_TITLE = "关于我们--三分钟了解弘则研究体系和方法论"
 )