Răsfoiți Sursa

wip:接口返回权限判断

wangkaiyue 2 ani în urmă
părinte
comite
fff830946f
2 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 4 0
      entity/mananger/aheadManager.go
  2. 1 1
      entity/mananger/customManager.go

+ 4 - 0
entity/mananger/aheadManager.go

@@ -45,6 +45,10 @@ func (this *AheadManager) GetData(userId, keyWords string, isNew bool, t int64)
 	if !(isNew || this.checkGroupUser(userId)) {
 		return nil
 	}
+	//查询是否是有超前项目权限
+	if power.HasAheadPower(userId) {
+		return nil
+	}
 	//校验每日请求次数
 	cacheKey := fmt.Sprintf(AheadRequestFrequencyCacheKey, time.Now().Format(public.TimeFormat), t, userId)
 	if this.Conf.DailyTimes <= redis.GetInt(AheadCacheDb, cacheKey) {

+ 1 - 1
entity/mananger/customManager.go

@@ -58,7 +58,7 @@ func (this *CustomManager) GetData(userId, keyWords string, isNew bool) map[stri
 	if !(isNew || this.checkActivityUser(userId)) {
 		return nil
 	}
-	//查询是否是付费用户
+	//查询是否是有定制化分析报告权限
 	if power.HasPower(userId) {
 		return nil
 	}