Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HeliosJ
gin-vue-admin
提交
aa4fa94c
G
gin-vue-admin
项目概览
HeliosJ
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
4
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 搜索 >>
提交
aa4fa94c
编写于
4月 24, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复前端项目代码丢失,问题,修复角色拷贝功能
上级
229ad72d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
3 deletion
+13
-3
server/api/v1/sys_authority.go
server/api/v1/sys_authority.go
+1
-1
server/service/sys_authority.go
server/service/sys_authority.go
+10
-0
web/src/view/superAdmin/authority/authority.vue
web/src/view/superAdmin/authority/authority.vue
+2
-2
未找到文件。
server/api/v1/sys_authority.go
浏览文件 @
aa4fa94c
...
...
@@ -42,7 +42,7 @@ func CopyAuthority(c *gin.Context) {
_
=
c
.
ShouldBindJSON
(
&
copyInfo
)
err
,
authBack
:=
service
.
CopyAuthority
(
copyInfo
)
if
err
!=
nil
{
response
.
FailWithMessage
(
fmt
.
Sprintf
(
"
创建
失败,%v"
,
err
),
c
)
response
.
FailWithMessage
(
fmt
.
Sprintf
(
"
拷贝
失败,%v"
,
err
),
c
)
}
else
{
response
.
OkWithData
(
resp
.
SysAuthorityResponse
{
Authority
:
authBack
},
c
)
}
...
...
server/service/sys_authority.go
浏览文件 @
aa4fa94c
...
...
@@ -17,6 +17,11 @@ import (
// @return authority model.SysAuthority
func
CreateAuthority
(
auth
model
.
SysAuthority
)
(
err
error
,
authority
model
.
SysAuthority
)
{
var
authorityBox
model
.
SysAuthority
notHas
:=
global
.
GVA_DB
.
Where
(
"authority_id = ?"
,
auth
.
AuthorityId
)
.
Find
(
&
authorityBox
)
.
RecordNotFound
()
if
!
notHas
{
return
errors
.
New
(
"存在相同角色id"
),
auth
}
err
=
global
.
GVA_DB
.
Create
(
&
auth
)
.
Error
return
err
,
auth
}
...
...
@@ -29,6 +34,11 @@ func CreateAuthority(auth model.SysAuthority) (err error, authority model.SysAut
// @return authority model.SysAuthority
func
CopyAuthority
(
copyInfo
response
.
SysAuthorityCopyResponse
)
(
err
error
,
authority
model
.
SysAuthority
)
{
var
authorityBox
model
.
SysAuthority
notHas
:=
global
.
GVA_DB
.
Where
(
"authority_id = ?"
,
copyInfo
.
Authority
.
AuthorityId
)
.
Find
(
&
authorityBox
)
.
RecordNotFound
()
if
!
notHas
{
return
errors
.
New
(
"存在相同角色id"
),
authority
}
copyInfo
.
Authority
.
Children
=
[]
model
.
SysAuthority
{}
err
,
menus
:=
GetMenuAuthority
(
copyInfo
.
OldAuthorityId
)
var
baseMenu
[]
model
.
SysBaseMenu
...
...
web/src/view/superAdmin/authority/authority.vue
浏览文件 @
aa4fa94c
...
...
@@ -130,11 +130,11 @@ export default {
this
.
dialogTitle
=
"
拷贝角色
"
this
.
dialogType
=
"
copy
"
for
(
let
k
in
this
.
form
)
{
this
.
form
[
k
ey
]
=
row
[
key
]
this
.
form
[
k
]
=
row
[
k
]
}
this
.
copyForm
=
row
this
.
dialogFormVisible
=
true
;
}
}
,
opdendrawer
(
row
)
{
this
.
drawer
=
true
this
.
activeRow
=
row
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录