|
@@ -18,7 +18,6 @@
|
|
<n-input
|
|
<n-input
|
|
v-model:value="formValue.username"
|
|
v-model:value="formValue.username"
|
|
:maxlength="8"
|
|
:maxlength="8"
|
|
- clearable
|
|
|
|
>
|
|
>
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<n-icon :component="UserOutlined" />
|
|
<n-icon :component="UserOutlined" />
|
|
@@ -29,9 +28,7 @@
|
|
<n-input
|
|
<n-input
|
|
v-model:value="formValue.password"
|
|
v-model:value="formValue.password"
|
|
type="password"
|
|
type="password"
|
|
- show-password-on="click"
|
|
|
|
:maxlength="8"
|
|
:maxlength="8"
|
|
- clearable
|
|
|
|
>
|
|
>
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<n-icon :component="LockOutlined" />
|
|
<n-icon :component="LockOutlined" />
|
|
@@ -42,11 +39,10 @@
|
|
<n-select
|
|
<n-select
|
|
v-model:value="formValue.role"
|
|
v-model:value="formValue.role"
|
|
:options="generalOptions"
|
|
:options="generalOptions"
|
|
- clearable
|
|
|
|
/>
|
|
/>
|
|
</n-form-item>
|
|
</n-form-item>
|
|
<n-form-item>
|
|
<n-form-item>
|
|
- <n-button type="primary" block @click="handleSubmit"
|
|
|
|
|
|
+ <n-button type="primary" block @click="handleLogin"
|
|
><span class="text-white">立即登录</span></n-button
|
|
><span class="text-white">立即登录</span></n-button
|
|
>
|
|
>
|
|
</n-form-item>
|
|
</n-form-item>
|
|
@@ -82,7 +78,7 @@ const rules = {
|
|
const formValue = reactive({
|
|
const formValue = reactive({
|
|
username: "",
|
|
username: "",
|
|
password: "",
|
|
password: "",
|
|
- role: "",
|
|
|
|
|
|
+ role: "管理员",
|
|
});
|
|
});
|
|
|
|
|
|
// 角色列表
|
|
// 角色列表
|
|
@@ -92,7 +88,7 @@ const generalOptions = ["管理员", "用户"].map((v) => ({
|
|
}));
|
|
}));
|
|
|
|
|
|
// 登录
|
|
// 登录
|
|
-const handleSubmit = async () => {
|
|
|
|
|
|
+const handleLogin = async () => {
|
|
formRef.value.validate(async (errors) => {
|
|
formRef.value.validate(async (errors) => {
|
|
if (!errors) {
|
|
if (!errors) {
|
|
try {
|
|
try {
|