修改权限认证状态1
This commit is contained in:
parent
79de15f061
commit
dcb2d6a988
@ -239,6 +239,11 @@ func (r *AdminUser) PutAdminUser(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if loginUserId == userId && (req.Status == 1 || req.Status == 2 || req.Status == 3) {
|
||||
responses.FailWithMessage("不可修改自己用户状态", c)
|
||||
return
|
||||
}
|
||||
|
||||
if loginUserId != userId && loginAdminUser.IsAdmin != 1 {
|
||||
responses.FailWithMessage("非管理员用户只可修改自己数据", c)
|
||||
return
|
||||
@ -285,6 +290,7 @@ func (r *AdminUser) PutAdminUser(c *gin.Context) {
|
||||
|
||||
data := make(map[string]interface{})
|
||||
data["access"] = req.Access
|
||||
data["status"] = req.Status
|
||||
data["is_deleted"] = req.IsDeleted
|
||||
data["is_disabled"] = req.IsDisabled
|
||||
data["nick_name"] = req.NickName
|
||||
|
||||
@ -41,6 +41,7 @@ type AddAdminUser struct {
|
||||
// PutAdminUser 修改
|
||||
type PutAdminUser struct {
|
||||
Access string `json:"access" form:"access" validate:"required" label:"账号"`
|
||||
Status int `json:"status" form:"status" label:"状态" validate:"required,oneof=1 2 3"` // 状态(1:正常 2:审核中 3:审核失败)
|
||||
IsDeleted int `json:"is_deleted" form:"is_deleted" validate:"omitempty,oneof=0 1" label:"删除状态"` // 是否被删除(0:否 1:是)
|
||||
IsDisabled int `json:"is_disabled" form:"is_disabled" validate:"omitempty,oneof=0 1" label:"禁用状态"` // 是否被禁用(0:否 1:是)
|
||||
NickName string `json:"nick_name" form:"nick_name" validate:"required" label:"昵称"`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user