增加管理员的头像编辑
This commit is contained in:
parent
e87bc38e14
commit
60f25b2598
@ -35,7 +35,7 @@ class AccountController extends BaseController {
|
|||||||
@permission('admin:save')
|
@permission('admin:save')
|
||||||
@router('post /admin/save')
|
@router('post /admin/save')
|
||||||
async save(req) {
|
async save(req) {
|
||||||
const { id, username, password, roles, showname, sex, locked, department, level } = req.params
|
const { id, username, password, roles, showname, sex, locked, department, level, avatar } = req.params
|
||||||
let account
|
let account
|
||||||
if (id) {
|
if (id) {
|
||||||
account = await Admin.findById(id)
|
account = await Admin.findById(id)
|
||||||
@ -68,6 +68,9 @@ class AccountController extends BaseController {
|
|||||||
if (level) {
|
if (level) {
|
||||||
account.level = level
|
account.level = level
|
||||||
}
|
}
|
||||||
|
if (avatar) {
|
||||||
|
account.avatar = avatar
|
||||||
|
}
|
||||||
if (locked != undefined) {
|
if (locked != undefined) {
|
||||||
if (locked) {
|
if (locked) {
|
||||||
if (ADMINS.indexOf(username) >= 0) {
|
if (ADMINS.indexOf(username) >= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user