Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梁国权
gin-vue-admin
提交
5955071f
G
gin-vue-admin
项目概览
梁国权
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5955071f
编写于
5月 29, 2021
作者:
Mr.奇淼(
提交者:
GitHub
5月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #496 from flipped-aurora/gva_gormv2_dev
修复casbin map占用问题
上级
4b8f0df9
40b6f04b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
16 addition
and
8 deletion
+16
-8
server/core/server.go
server/core/server.go
+1
-1
server/service/sys_casbin.go
server/service/sys_casbin.go
+14
-6
web/src/main.js
web/src/main.js
+1
-1
未找到文件。
server/core/server.go
浏览文件 @
5955071f
...
@@ -29,7 +29,7 @@ func RunWindowsServer() {
...
@@ -29,7 +29,7 @@ func RunWindowsServer() {
fmt
.
Printf
(
`
fmt
.
Printf
(
`
欢迎使用 Gin-Vue-Admin
欢迎使用 Gin-Vue-Admin
当前版本:V2.4.
1
当前版本:V2.4.
2
加群方式:微信号:shouzi_1994 QQ群:622360840
加群方式:微信号:shouzi_1994 QQ群:622360840
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
默认前端文件运行地址:http://127.0.0.1:8080
...
...
server/service/sys_casbin.go
浏览文件 @
5955071f
...
@@ -10,6 +10,7 @@ import (
...
@@ -10,6 +10,7 @@ import (
gormadapter
"github.com/casbin/gorm-adapter/v3"
gormadapter
"github.com/casbin/gorm-adapter/v3"
_
"github.com/go-sql-driver/mysql"
_
"github.com/go-sql-driver/mysql"
"strings"
"strings"
"sync"
)
)
//@author: [piexlmax](https://github.com/piexlmax)
//@author: [piexlmax](https://github.com/piexlmax)
...
@@ -88,12 +89,19 @@ func ClearCasbin(v int, p ...string) bool {
...
@@ -88,12 +89,19 @@ func ClearCasbin(v int, p ...string) bool {
//@description: 持久化到数据库 引入自定义规则
//@description: 持久化到数据库 引入自定义规则
//@return: *casbin.Enforcer
//@return: *casbin.Enforcer
func
Casbin
()
*
casbin
.
Enforcer
{
var
(
syncedEnforcer
*
casbin
.
SyncedEnforcer
once
sync
.
Once
)
func
Casbin
()
*
casbin
.
SyncedEnforcer
{
once
.
Do
(
func
()
{
a
,
_
:=
gormadapter
.
NewAdapterByDB
(
global
.
GVA_DB
)
a
,
_
:=
gormadapter
.
NewAdapterByDB
(
global
.
GVA_DB
)
e
,
_
:=
casbin
.
NewEnforcer
(
global
.
GVA_CONFIG
.
Casbin
.
ModelPath
,
a
)
syncedEnforcer
,
_
=
casbin
.
NewSyncedEnforcer
(
global
.
GVA_CONFIG
.
Casbin
.
ModelPath
,
a
)
e
.
AddFunction
(
"ParamsMatch"
,
ParamsMatchFunc
)
syncedEnforcer
.
AddFunction
(
"ParamsMatch"
,
ParamsMatchFunc
)
_
=
e
.
LoadPolicy
()
})
return
e
_
=
syncedEnforcer
.
LoadPolicy
()
return
syncedEnforcer
}
}
//@author: [piexlmax](https://github.com/piexlmax)
//@author: [piexlmax](https://github.com/piexlmax)
...
...
web/src/main.js
浏览文件 @
5955071f
...
@@ -149,7 +149,7 @@ export default new Vue({
...
@@ -149,7 +149,7 @@ export default new Vue({
console
.
log
(
`
console
.
log
(
`
欢迎使用 Gin-Vue-Admin
欢迎使用 Gin-Vue-Admin
当前版本:V2.4.
1
当前版本:V2.4.
2
加群方式:微信:shouzi_1994 QQ群:622360840
加群方式:微信:shouzi_1994 QQ群:622360840
默认自动化文档地址:http://127.0.0.1:
${
process
.
env
.
VUE_APP_SERVER_PORT
}
/swagger/index.html
默认自动化文档地址:http://127.0.0.1:
${
process
.
env
.
VUE_APP_SERVER_PORT
}
/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:
${
process
.
env
.
VUE_APP_CLI_PORT
}
默认前端文件运行地址:http://127.0.0.1:
${
process
.
env
.
VUE_APP_CLI_PORT
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录