fix: 修复用户管理问题

This commit is contained in:
wangdan-fit2cloud 2024-03-21 18:01:04 +08:00
parent 40608781c3
commit c4a25a0f52
3 changed files with 19 additions and 23 deletions

View File

@ -31,23 +31,10 @@
<span>论坛求助</span> <span>论坛求助</span>
</div> </div>
</el-card> </el-card>
<div class="text-center">当前版本号{{ version }}</div>
</div> </div>
<!-- <ul class="about-ui"> <div class="text-center">
<li class="flex mb-16"> 当前版本号v1.0.0-dev (build at 2024-03-21T17:32, commit: 40608781)
<span class="label text-right">授权数量</span><span class="text-center">-</span> </div>
</li>
<li class="flex mb-16">
<span class="label text-right">过期时间</span><span class="text-center">-</span>
</li>
<li class="flex mb-16">
<span class="label text-right">版本</span><span class="text-center">-</span>
</li>
<li class="flex">
<span class="label text-right">版本号</span
><span class="text-center">{{ PackageJSON.version }}</span>
</li>
</ul> -->
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -72,9 +59,10 @@ defineExpose({ open })
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>
.about-dialog { .about-dialog {
padding: 0; padding: 0 0 24px 0;
border-radius: 4px; border-radius: 4px;
width: 600px; width: 600px;
font-weight: 400;
.el-dialog__header { .el-dialog__header {
background: var(--app-header-bg-color); background: var(--app-header-bg-color);
margin-right: 0; margin-right: 0;
@ -95,11 +83,11 @@ defineExpose({ open })
height: 59px; height: 59px;
} }
.about-ui { .about-ui {
padding: 24px;
width: 360px; width: 360px;
margin: 0 auto; margin: 0 auto;
font-weight: 400; font-weight: 400;
font-size: 16px; font-size: 16px;
margin-top: 24px;
.label { .label {
width: 180px; width: 180px;
text-align: left; text-align: left;

View File

@ -12,7 +12,7 @@
<el-input <el-input
v-model="userForm.username" v-model="userForm.username"
placeholder="请输入用户名" placeholder="请输入用户名"
maxlength="64" maxlength="20"
show-word-limit show-word-limit
> >
</el-input> </el-input>
@ -73,8 +73,16 @@ const userForm = ref<any>({
}) })
const rules = reactive({ const rules = reactive({
username: [{ required: true, message: '请输入用户名' }], username: [
email: [{ required: true, message: '请输入邮箱' }], { required: true, message: '请输入用户名', trigger: 'blur' },
{
min: 6,
max: 20,
message: '长度在 6 到 20 个字符',
trigger: 'blur'
}
],
email: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
password: [ password: [
{ {
required: true, required: true,
@ -102,8 +110,8 @@ watch(dialogVisible, (bool) => {
phone: '', phone: '',
nick_name: '' nick_name: ''
} }
userFormRef.value?.clearValidate()
isEdit.value = false isEdit.value = false
userFormRef.value?.clearValidate()
} }
}) })

View File

@ -99,13 +99,13 @@ watch(dialogVisible, (bool) => {
password: '', password: '',
re_password: '' re_password: ''
} }
userFormRef.value?.clearValidate()
} }
}) })
const open = (data: any) => { const open = (data: any) => {
userId.value = data.id userId.value = data.id
dialogVisible.value = true dialogVisible.value = true
userFormRef.value?.clearValidate()
} }
const submit = async (formEl: FormInstance | undefined) => { const submit = async (formEl: FormInstance | undefined) => {