From eac01bdc92b8fbde9f6d2269d58015ad17804afa Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Thu, 20 May 2021 11:23:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmap=E7=AB=9E=E4=BA=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/sys_casbin.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/service/sys_casbin.go b/server/service/sys_casbin.go index 556dd086..a83c0202 100644 --- a/server/service/sys_casbin.go +++ b/server/service/sys_casbin.go @@ -101,10 +101,8 @@ func Casbin() *casbin.Enforcer { a, _ := gormadapter.NewAdapterByDB(global.GVA_DB) e, _ = casbin.NewEnforcer(global.GVA_CONFIG.Casbin.ModelPath, a) e.AddFunction("ParamsMatch", ParamsMatchFunc) + _ = e.LoadPolicy() }) - eLock.Lock() - _ = e.LoadPolicy() - eLock.Unlock() return e }