|
@ -27,7 +27,7 @@ func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) { |
|
|
func (a *SysAuthority) DeleteAuthority() (err error) { |
|
|
func (a *SysAuthority) DeleteAuthority() (err error) { |
|
|
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error |
|
|
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
err = qmsql.DEFAULTDB.Where("parentId = ?", a.AuthorityId).Find(&SysAuthority{}).Error |
|
|
|
|
|
|
|
|
err = qmsql.DEFAULTDB.Where("parent_id = ?", a.AuthorityId).Find(&SysAuthority{}).Error |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error |
|
|
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error |
|
|
new(CasbinModel).clearCasbin(0, a.AuthorityId) |
|
|
new(CasbinModel).clearCasbin(0, a.AuthorityId) |
|
|