浏览代码

no message

xingzai 8 月之前
父节点
当前提交
c135983d7f
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      controllers/yanxuan_special.go

+ 10 - 6
controllers/yanxuan_special.go

@@ -158,12 +158,12 @@ func (this *BaseAuthMobileController) Detail() {
 		this.ServeJSON()
 		this.ServeJSON()
 	}()
 	}()
 	user := this.User
 	user := this.User
-	//if sysUser == nil {
-	//	br.Msg = "请登录"
-	//	br.ErrMsg = "请登录1,SysUser Is Empty"
-	//	br.Ret = 408
-	//	return
-	//}
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录1,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
 
 
 	specialId, _ := this.GetInt("Id", 0)
 	specialId, _ := this.GetInt("Id", 0)
 	isSendWx, _ := this.GetInt("IsSendWx", 0)
 	isSendWx, _ := this.GetInt("IsSendWx", 0)
@@ -255,6 +255,10 @@ func (this *BaseAuthMobileController) Detail() {
 		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		return
 		return
 	}
 	}
+	//看自己的文章时不设权限限制,不需要判断是否有研选订阅权限,都可以看。
+	if user.UserId == item.UserId {
+		havePower = true
+	}
 	var hasPermission int
 	var hasPermission int
 	if havePower {
 	if havePower {
 		hasPermission = 1
 		hasPermission = 1