Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
祺技世界
gin-vue-admin
提交
50f962da
G
gin-vue-admin
项目概览
祺技世界
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
6
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,体验更适合开发者的 AI 搜索 >>
提交
50f962da
编写于
8月 25, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改 authority 关联删除的问题
上级
cd708e3d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
8 deletion
+5
-8
server/config.yaml
server/config.yaml
+1
-1
server/go.mod
server/go.mod
+0
-5
server/service/sys_authority.go
server/service/sys_authority.go
+4
-2
未找到文件。
server/config.yaml
浏览文件 @
50f962da
...
...
@@ -13,7 +13,7 @@ mysql:
username
:
root
password
:
'
Aa@6447985'
path
:
'
127.0.0.1:3306'
db-name
:
'
qmPlus'
db-name
:
'
qmPlus
V2
'
config
:
'
charset=utf8&parseTime=True&loc=Local'
max-idle-conns
:
10
max-open-conns
:
10
...
...
server/go.mod
浏览文件 @
50f962da
...
...
@@ -6,7 +6,6 @@ require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/casbin/casbin v1.9.1
github.com/casbin/casbin/v2 v2.11.0
github.com/casbin/gorm-adapter v1.0.0
github.com/casbin/gorm-adapter/v3 v3.0.2
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
...
...
@@ -20,12 +19,10 @@ require (
github.com/go-sql-driver/mysql v1.5.0
github.com/golang/protobuf v1.4.2 // indirect
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jinzhu/gorm v1.9.12
github.com/json-iterator/go v1.1.10 // indirect
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/lib/pq v1.3.0 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mitchellh/mapstructure v1.2.2 // indirect
github.com/mojocn/base64Captcha v1.3.1
...
...
@@ -33,10 +30,8 @@ require (
github.com/onsi/gomega v1.4.3 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/piexlmax/gvaplug v0.0.8
github.com/pkg/errors v0.9.1 // indirect
github.com/qiniu/api.v7/v7 v7.4.1
github.com/qiniu/x v1.10.5
github.com/satori/go.uuid v1.2.0
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
...
...
server/service/sys_authority.go
浏览文件 @
50f962da
...
...
@@ -87,9 +87,11 @@ func DeleteAuthority(auth *model.SysAuthority) (err error) {
if
!
notHas
{
return
errors
.
New
(
"此角色存在子角色不允许删除"
)
}
db
:=
global
.
GVA_DB
.
Preload
(
"SysBaseMenus"
)
.
Where
(
"authority_id = ?"
,
auth
.
AuthorityId
)
.
First
(
auth
)
.
Unscoped
()
.
Delete
(
auth
)
db
:=
global
.
GVA_DB
.
Preload
(
"SysBaseMenus"
)
.
Where
(
"authority_id = ?"
,
auth
.
AuthorityId
)
.
First
(
auth
)
err
=
db
.
Unscoped
()
.
Delete
(
auth
)
.
Error
if
len
(
auth
.
SysBaseMenus
)
>
0
{
err
=
db
.
Association
(
"SysBaseMenus"
)
.
Delete
(
auth
.
SysBaseMenus
)
err
=
global
.
GVA_DB
.
Model
(
auth
)
.
Association
(
"SysBaseMenus"
)
.
Delete
(
auth
.
SysBaseMenus
)
//err = db.Association("SysBaseMenus").Delete(&auth)
}
else
{
err
=
db
.
Error
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录