整体优化完善接口与数据权限检查

This commit is contained in:
2026-03-28 14:18:11 +08:00
parent 51c377964d
commit 22cb2d50d3
21 changed files with 161 additions and 98 deletions

View File

@@ -121,7 +121,7 @@ func PageUserByAdmin(c *fiber.Ctx) error {
// 查询用户列表
users, total, err := q.User.Debug().
Preload(q.User.Admin).
Preload(q.User.Admin, q.User.Discount).
Omit(q.User.Password).
Where(do).
Order(q.User.CreatedAt).
@@ -159,7 +159,7 @@ type PageUserByAdminReq struct {
// 绑定管理员
func BindAdmin(c *fiber.Ctx) error {
// 检查权限
authCtx, err := auth.GetAuthCtx(c).PermitAdmin()
authCtx, err := auth.GetAuthCtx(c).PermitAdmin(core.ScopeUserWrite)
if err != nil {
return err
}