diff --git a/admin/src/api/index.js b/admin/src/api/index.js index 37bc8dc..84c5a8b 100644 --- a/admin/src/api/index.js +++ b/admin/src/api/index.js @@ -20,6 +20,10 @@ const urlPick = () => { } } urlPick() +export const AdminResetPasswordAction = async (data) => await $post({ + url: `${url}/api/${app_name}/Admin/reset_password`, + data +}, true) export const ConfigCreateAction = async (data) => await $post({ url: `${url}/api/${app_name}/Config/create`, data diff --git a/admin/src/components/Menu.vue b/admin/src/components/Menu.vue index 8630015..f1047b2 100644 --- a/admin/src/components/Menu.vue +++ b/admin/src/components/Menu.vue @@ -41,44 +41,46 @@ const menuItemClick = (name) => { @@ -95,7 +97,7 @@ const menuItemClick = (name) => { color: var(--el-menu-active-color); } -.aside_menu_wrapper > .el-menu { +.aside_menu_wrapper .el-menu { border: none; } diff --git a/admin/src/pages/admin/list.vue b/admin/src/pages/admin/list.vue index 0fdc8e3..5665119 100644 --- a/admin/src/pages/admin/list.vue +++ b/admin/src/pages/admin/list.vue @@ -9,6 +9,7 @@ import { AdminUpdateAction, AdminDeleteAction, AdminListAction, + AdminResetPasswordAction, AdminAuthGroupSelectAction, $image, $response, $base64, UploadImageAction @@ -146,13 +147,13 @@ const AdminDelete = async () => { } const deleteClick = () => { window.$box.confirm( - '是否确认删除该管理员?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - } + '是否确认删除该管理员?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + } ).then(() => { AdminDelete() }).catch(() => { @@ -190,6 +191,34 @@ ${copy_data.value.initial_password === 1 ? '请务必' : '建议'}在登录后 window.$message().success('内容已复制') }) } + +const resetPasswordClick = () => { + window.$box.confirm( + '是否确认重置该管理员的密码?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + } + ).then(() => { + AdminResetPassword() + }).catch(() => { + }) +} + +const AdminResetPassword = async () => { + const response = await AdminResetPasswordAction({ + id: edit_data.value.id + }) + $response(response, () => { + copy_data.value = JSON.parse(JSON.stringify({ + ...edit_data.value, + password: response.data.password + })) + copy_show.value = true + }) +}