public: 发布2.8.0版本 (#1998)

* feat:修改token获取优先级,优先从header获取

* feat: 增加业务ctx的传递

* fix文件选择问题,
有公共函数onDownloadFile,去掉downloadFile

* 没问题

* feat: 增加context引入

* fix: 修复图片多选的情况下点击确定抽屉无法收起的bug

* feat: 提高header的token优先级,优化导出表格逻辑,不再依赖于cookie鉴权

---------

Co-authored-by: piexlMax(奇淼 <qimiaojiangjizhao@gmail.com>
Co-authored-by: task <121913992@qq.com>
This commit is contained in:
PiexlMax(奇淼
2025-03-15 13:31:33 +08:00
committed by GitHub
parent f776a061ce
commit ab75bc7f59
29 changed files with 416 additions and 100 deletions

View File

@@ -40,10 +40,10 @@ func SetToken(c *gin.Context, token string, maxAge int) {
}
func GetToken(c *gin.Context) string {
token, _ := c.Cookie("x-token")
token := c.Request.Header.Get("x-token")
if token == "" {
j := NewJWT()
token = c.Request.Header.Get("x-token")
token, _ = c.Cookie("x-token")
claims, err := j.ParseToken(token)
if err != nil {
global.GVA_LOG.Error("重新写入cookie token失败,未能成功解析token,请检查请求头是否存在x-token且claims是否为规定结构")