Explorar o código

Merge branch 'eta/2.4.5' into debug

# Conflicts:
#	controllers/excel_info.go
#	models/response/excel_info.go
#	utils/constants.go
Roc hai 4 semanas
pai
achega
35628bff23

+ 1 - 1
controllers/chart_common.go

@@ -57,7 +57,7 @@ func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
 
 	chartInfo, err := models.GetChartInfoByUniqueCode(uniqueCode)
 	if err != nil {
-		if err.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(err) {
 			br.Msg = "该图已被删除,请刷新页面"
 			br.ErrMsg = "该图已被删除,请刷新页面,Err:" + err.Error()
 			return

+ 1 - 3
controllers/excel_info.go

@@ -55,11 +55,10 @@ func (this *ExcelInfoController) GetTableDetail() {
 		return
 	}
 
-	key := utils.HZ_CHART_LIB_EXCEL_TABLE_DETAIL + ":" + uniqueCode
 	resp := new(response.ExcelTableDetailResp)
 	excelInfo, err := models.GetExcelInfoByUniqueCode(uniqueCode)
 	if err != nil {
-		if err.Error() == utils.ErrNoRow() {
+		if utils.IsErrNoRow(err) {
 			br.Msg = "该表格已被删除,请刷新页面"
 			br.ErrMsg = "该表格已被删除,请刷新页面,Err:" + err.Error()
 			return
@@ -312,7 +311,6 @@ func (this *ExcelInfoController) GetTableDetail() {
 	}
 
 	resp.IsAuth = true
-
 	resp.TableInfo = tableData
 	resp.Source = excelInfo.Source
 	resp.ExcelType = excelInfo.ExcelType

+ 1 - 1
models/response/excel_info.go

@@ -18,10 +18,10 @@ type ExcelTableDetailResp struct {
 	SourcesFrom           string `description:"图表来源"`
 	ExcelSource           string `description:"表格来源str"`
 	ExcelSourceEn         string `description:"表格来源(英文)"`
+	IsAuth        bool   `description:"是否授权"`
 	TableInfo             excel.TableData
 	Config                ExcelTableDetailConfigResp
 	ReferencedExcelConfig models.ReferencedExcelConfig `description:"表格引用信息"`
-	IsAuth        bool   `description:"是否授权"`
 }
 
 // ExcelTableDetailConfigResp

+ 1 - 1
utils/constants.go

@@ -233,7 +233,7 @@ const (
 )
 
 const (
-	CACHE_CHART_AUTH = "chart:auth:" //图表数据
+	CACHE_CHART_AUTH = "eta:chart:auth:" //图表数据
 )
 
 const (