作者 tangxvhui

更新管理员管理

... ... @@ -32,6 +32,7 @@ type adminDetailParam struct {
PermissionType []int `json:"permissionType"`
Status int `json:"status"`
Account string `json:"account"`
IsAdmin int `json:"isAdmin"`
}
func (c *AdminUserController) SaveAdminUser() {
... ... @@ -91,6 +92,7 @@ func (c *AdminUserController) GetAdminUser() {
Id: adminuser.Id,
Account: adminuser.Account,
Status: 0,
IsAdmin: 0,
}
for _, v := range adminuser.Permission {
rspData.PermissionType = append(rspData.PermissionType, v.Id)
... ... @@ -98,6 +100,9 @@ func (c *AdminUserController) GetAdminUser() {
if adminuser.IsUsable {
rspData.Status = 1
}
if adminuser.IsDefault {
rspData.IsAdmin = 1
}
c.ResponseData(rspData)
return
}
... ... @@ -162,10 +167,14 @@ func (c *AdminUserController) ListAdminUser() {
"account": adminusers[i].Account,
"permission": permissionTypes,
"statue": 0,
"isAdmin": 0,
}
if adminusers[i].IsUsable {
m["statue"] = 1
}
if adminusers[i].IsDefault {
m["statue"] = 1
}
listData = append(listData, m)
}
c.ResponsePageList(listData, cnt, param.PageNumber)
... ...