修复前端项目代码丢失,问题,修复角色拷贝功能
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user