Browse Source

fix:时间调整为120分钟

Roc 6 days ago
parent
commit
366a43fe55
2 changed files with 4 additions and 5 deletions
  1. 1 1
      controllers/data_manage/chart_common.go
  2. 3 4
      services/report_v2.go

+ 1 - 1
controllers/data_manage/chart_common.go

@@ -273,7 +273,7 @@ func (this *ChartInfoController) GeneralChartToken() {
 		if source == `table` {
 			sourceType = source
 		}
-		token, err = services.GeneralChartToken(sourceType, uniqueCode, 30*time.Minute)
+		token, err = services.GeneralChartToken(sourceType, uniqueCode)
 		if err != nil {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取失败"

+ 3 - 4
services/report_v2.go

@@ -1656,7 +1656,7 @@ func linkAddToken(link string, tokenMap map[string]string) string {
 
 	// 如果之前没有token,那么就重新生成token
 	if token == `` {
-		token, err = GeneralChartToken(showType, code, 30*time.Minute)
+		token, err = GeneralChartToken(showType, code)
 		if err != nil {
 			return link
 		}
@@ -1706,14 +1706,13 @@ func linkDelToken(link string) string {
 // @datetime 2025-01-07 10:41:36
 // @param showType string
 // @param uniqueCode string
-// @param expireTime time.Duration
 // @return token string
 // @return err error
-func GeneralChartToken(showType, uniqueCode string, expireTime time.Duration) (token string, err error) {
+func GeneralChartToken(showType, uniqueCode string) (token string, err error) {
 	// 缓存key
 	token = utils.MD5(fmt.Sprint(showType+`:`, uniqueCode, time.Now().UnixNano()/1e6))
 	key := fmt.Sprint(utils.CACHE_CHART_AUTH, token)
-	err = utils.Rc.Put(key, uniqueCode, expireTime)
+	err = utils.Rc.Put(key, uniqueCode, utils.BusinessConfReportChartExpiredTime)
 
 	return
 }