调整角色ID为uint格式,增加embed打包,更改日志格式。 (#1144)
* feature: 根据 #377 pr进行修改embed, 打包静态文件夹与配置文件 * 修改角色id为uint * 修改日志格式 Co-authored-by: SliverHorn <503551462@qq.com> Co-authored-by: cg81344 <cg831344@126.com>
This commit is contained in:
committed by
GitHub
co-authored by
SliverHorn
cg81344
parent
cd68d1f198
commit
0610419e38
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/service"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService
|
||||
@@ -19,9 +20,8 @@ func CasbinHandler() gin.HandlerFunc {
|
||||
// 获取请求方法
|
||||
act := c.Request.Method
|
||||
// 获取用户的角色
|
||||
sub := waitUse.AuthorityId
|
||||
e := casbinService.Casbin()
|
||||
// 判断策略中是否存在
|
||||
sub := strconv.Itoa(int(waitUse.AuthorityId))
|
||||
e := casbinService.Casbin() // 判断策略中是否存在
|
||||
success, _ := e.Enforce(sub, obj, act)
|
||||
if global.GVA_CONFIG.System.Env == "develop" || success {
|
||||
c.Next()
|
||||
|
||||
Reference in New Issue
Block a user