File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,15 @@ func (authorityService *AuthorityService) DeleteAuthority(auth *system.SysAuthor
125125 return
126126 }
127127 // err = db.Association("SysBaseMenus").Delete(&auth)
128- } else {
129- err = db .Error
130- if err != nil {
131- return
132- }
133128 }
134129 err = global .GVA_DB .Delete (& []system.SysUserAuthority {}, "sys_authority_authority_id = ?" , auth .AuthorityId ).Error
130+ if err != nil {
131+ return
132+ }
135133 err = global .GVA_DB .Delete (& []system.SysAuthorityBtn {}, "authority_id = ?" , auth .AuthorityId ).Error
134+ if err != nil {
135+ return
136+ }
136137 authorityId := strconv .Itoa (int (auth .AuthorityId ))
137138 CasbinServiceApp .ClearCasbin (0 , authorityId )
138139 return err
@@ -153,10 +154,8 @@ func (authorityService *AuthorityService) GetAuthorityInfoList(info request.Page
153154 }
154155 var authority []system.SysAuthority
155156 err = db .Limit (limit ).Offset (offset ).Preload ("DataAuthorityId" ).Where ("parent_id = ?" , "0" ).Find (& authority ).Error
156- if len (authority ) > 0 {
157- for k := range authority {
158- err = authorityService .findChildrenAuthority (& authority [k ])
159- }
157+ for k := range authority {
158+ err = authorityService .findChildrenAuthority (& authority [k ])
160159 }
161160 return authority , total , err
162161}
You can’t perform that action at this time.
0 commit comments