mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
调整角色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
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"go.uber.org/zap"
|
||||
"strconv"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -22,7 +23,8 @@ type CasbinService struct{}
|
||||
|
||||
var CasbinServiceApp = new(CasbinService)
|
||||
|
||||
func (casbinService *CasbinService) UpdateCasbin(authorityId string, casbinInfos []request.CasbinInfo) error {
|
||||
func (casbinService *CasbinService) UpdateCasbin(AuthorityID uint, casbinInfos []request.CasbinInfo) error {
|
||||
authorityId := strconv.Itoa(int(AuthorityID))
|
||||
casbinService.ClearCasbin(0, authorityId)
|
||||
rules := [][]string{}
|
||||
for _, v := range casbinInfos {
|
||||
@@ -56,8 +58,9 @@ func (casbinService *CasbinService) UpdateCasbinApi(oldPath string, newPath stri
|
||||
//@param: authorityId string
|
||||
//@return: pathMaps []request.CasbinInfo
|
||||
|
||||
func (casbinService *CasbinService) GetPolicyPathByAuthorityId(authorityId string) (pathMaps []request.CasbinInfo) {
|
||||
func (casbinService *CasbinService) GetPolicyPathByAuthorityId(AuthorityID uint) (pathMaps []request.CasbinInfo) {
|
||||
e := casbinService.Casbin()
|
||||
authorityId := strconv.Itoa(int(AuthorityID))
|
||||
list := e.GetFilteredPolicy(0, authorityId)
|
||||
for _, v := range list {
|
||||
pathMaps = append(pathMaps, request.CasbinInfo{
|
||||
|
||||
Reference in New Issue
Block a user