* fixed: 修复addFunction下前端api.js无法创建的bug。

* feature: 增加严格角色模式

* Update system.vue

* fixed: 多点登录拦截模式下,jwt换票期间不需要拉黑token。

* fixed: 修复使用ast时候产生无意义的换行的问题

* fixed: 修复跨级操作角色权限的越权问题

* feature: 优化严格模式角色鉴权操作。

* fixed: 增加菜单和api设置越权问题的限制

* feature: 增加插件打包前的自动化同步所需菜单和api的功能

* feature: 自动化代码可以默认生成导入导出

* feature: 自动化导入导出对模板进行回滚

* feature: 剔除无用的packfile代码包

* feature: 发布V2.7.3版本公测。

---------

Co-authored-by: task <ms.yangdan@gmail.com>
This commit is contained in:
PiexlMax(奇淼
2024-08-27 13:15:56 +08:00
committed by GitHub
co-authored by task
parent 87ced16d63
commit 866fa5643e
52 changed files with 1506 additions and 629 deletions
+8
View File
@@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/gofrs/uuid/v5"
"net"
"time"
)
func ClearToken(c *gin.Context) {
@@ -40,7 +41,14 @@ func SetToken(c *gin.Context, token string, maxAge int) {
func GetToken(c *gin.Context) string {
token, _ := c.Cookie("x-token")
if token == "" {
j := NewJWT()
token = c.Request.Header.Get("x-token")
claims, err := j.ParseToken(token)
if err != nil {
global.GVA_LOG.Error("重新写入cookie token失败,未能成功解析token,请检查请求头是否存在x-token且claims是否为规定结构")
return token
}
SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
}
return token
}