mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-12 02:58:39 +08:00
refactor: 优化系统日志、在线用户、存储管理、部门管理相关代码
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
:title="title"
|
||||
:mask-closable="false"
|
||||
:esc-to-close="false"
|
||||
:width="width >= 580 ? 580 : '100%'"
|
||||
:width="width >= 600 ? 600 : '100%'"
|
||||
@before-ok="save"
|
||||
@close="reset"
|
||||
>
|
||||
@@ -160,6 +160,7 @@ const onUpdate = async (id: string) => {
|
||||
|
||||
// 保存
|
||||
const save = async () => {
|
||||
const rawPassword = form.password
|
||||
try {
|
||||
const isInvalid = await formRef.value?.validate()
|
||||
if (isInvalid) return false
|
||||
@@ -167,19 +168,16 @@ const save = async () => {
|
||||
await updateUser(form, dataId.value)
|
||||
Message.success('修改成功')
|
||||
} else {
|
||||
const rawPassword = form.password
|
||||
if (rawPassword) {
|
||||
form.password = encryptByRsa(rawPassword) || ''
|
||||
}
|
||||
await addUser(form).catch(() => {
|
||||
form.password = rawPassword
|
||||
return false
|
||||
})
|
||||
await addUser(form)
|
||||
Message.success('新增成功')
|
||||
}
|
||||
emit('save-success')
|
||||
return true
|
||||
} catch (error) {
|
||||
form.password = rawPassword
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<a-drawer v-model:visible="visible" title="用户详情" :width="width >= 580 ? 580 : '100%'" :footer="false">
|
||||
<a-drawer v-model:visible="visible" title="用户详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
|
||||
<a-descriptions :column="2" size="large" class="general-description">
|
||||
<a-descriptions-item label="ID" :span="2">{{ dataDetail?.id }}</a-descriptions-item>
|
||||
<a-descriptions-item label="用户名">{{ dataDetail?.username }}</a-descriptions-item>
|
||||
|
||||
Reference in New Issue
Block a user