Skip to content

Commit

Permalink
修改获取角色列表没有检查err,优化查询逻辑 (flipped-aurora#1238)
Browse files Browse the repository at this point in the history
Co-authored-by: wangxd01 <wangxd01@mingyuanyun.com>
  • Loading branch information
2 people authored and yziwe committed Feb 26, 2023
1 parent 391f2cf commit 3e8af65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/service/system/sys_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ func (authorityService *AuthorityService) GetAuthorityInfoList(info request.Page
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
db := global.GVA_DB.Model(&system.SysAuthority{})
err = db.Where("parent_id = ?", "0").Count(&total).Error
if err = db.Where("parent_id = ?", "0").Count(&total).Error; total == 0 || err != nil {
return
}
var authority []system.SysAuthority
adminId, _ := strconv.Atoi(fmt.Sprintf("%d", sysId))
if adminId != 1 {
Expand Down

0 comments on commit 3e8af65

Please sign in to comment.