作者 tangxvhui

更新x-font-token处理

... ... @@ -413,5 +413,20 @@ func (srv StaffAssessServeice) ExportUserAssess(param *query.ListAssessContentCy
}
}
}
//TODO 调整样式
xlsxFile.MergeCell(sheetName, "A2", "A4")
xlsxFile.MergeCell(sheetName, "B2", "B4")
xlsxFile.MergeCell(sheetName, "B5", "B5")
//设置行高
for i := range tableRowSort {
xlsxFile.SetRowHeight(sheetName, i+6, 50)
}
//设置列宽
for i := range headerList {
colName, _ := excelize.ColumnNumberToName(i + 1)
if i == 0 {
xlsxFile.SetColWidth(sheetName, colName, colName, 70)
}
}
return xlsxFile, nil
}
... ...
package middlewares
import (
"strings"
"github.com/beego/beego/v2/server/web/context"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
... ... @@ -8,7 +10,17 @@ import (
func CheckFontToken() func(ctx *context.Context) {
return func(ctx *context.Context) {
adminToken := ctx.Input.Header("x-font-token")
// adminToken := ctx.Input.Header("x-font-token")
// Bearer authorization_token
adminToken := ctx.Input.Header("Authorization")
//以一个空格" ",做切分
strList := strings.Split(adminToken, " ")
if len(strList) > 1 {
adminToken = strList[1]
}
if len(strList) == 1 {
adminToken = strList[0]
}
userAuth, err := (&domain.UserAuth{}).ParseAccessToken(adminToken)
if err != nil || userAuth.UserId <= 0 {
forbidden(ctx)
... ...