|
|
@@ -2,14 +2,8 @@
|
|
|
<div class="form-title">
|
|
|
{{ form_type ? $t('login.registerModel') : $t('login.loginModel') }}
|
|
|
</div>
|
|
|
- <a-form
|
|
|
- ref="ref_form"
|
|
|
- :model="form"
|
|
|
- :rules="rules"
|
|
|
- :style="{ width: 'calc(100% - 40px)' }"
|
|
|
- layout="validate"
|
|
|
- @submit-success="handleSubmit"
|
|
|
- >
|
|
|
+ <a-form ref="ref_form" :model="form" :rules="rules" :style="{ width: 'calc(100% - 40px)' }" layout="validate"
|
|
|
+ @submit-success="handleSubmit">
|
|
|
<a-form-item field="username">
|
|
|
<a-input v-model="form.username" :placeholder="$t('login.usernameTips')">
|
|
|
<template #prefix> <icon-user /> </template>
|
|
|
@@ -21,23 +15,19 @@
|
|
|
</a-input>
|
|
|
</a-form-item>
|
|
|
<a-form-item field="password">
|
|
|
- <a-input-password
|
|
|
- v-model="form.password"
|
|
|
- :placeholder="$t('login.passwordTips')"
|
|
|
- :defaultVisibility="true"
|
|
|
- allow-clear
|
|
|
- >
|
|
|
+ <a-input-password v-model="form.password" :placeholder="$t('login.passwordTips')" :defaultVisibility="true"
|
|
|
+ allow-clear>
|
|
|
<template #prefix>
|
|
|
<icon-user />
|
|
|
</template>
|
|
|
</a-input-password>
|
|
|
</a-form-item>
|
|
|
<a-form-item>
|
|
|
- <a-button v-if="!form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading"
|
|
|
- >{{ $t('login.loginBtn') }}
|
|
|
+ <a-button v-if="!form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading">{{
|
|
|
+ $t('login.loginBtn') }}
|
|
|
</a-button>
|
|
|
- <a-button v-if="form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading"
|
|
|
- >{{ $t('login.registerBtn') }}
|
|
|
+ <a-button v-if="form_type" class="submit-btn" type="primary" html-type="submit" :loading="loading">{{
|
|
|
+ $t('login.registerBtn') }}
|
|
|
</a-button>
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
@@ -94,7 +84,7 @@ const handleSubmit = (data) => {
|
|
|
await userStore.getRoutesList();
|
|
|
// 登录成功后,获取用户权限
|
|
|
await userStore.getUserInfo();
|
|
|
- router.push({ path: '/knowledge' });
|
|
|
+ router.push({ path: '/' });
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
$message.error(err);
|
|
|
@@ -174,7 +164,7 @@ const changeFormType = (e) => {
|
|
|
border-color: var(--color-neutral-3);
|
|
|
}
|
|
|
|
|
|
-:deep .arco-form-item-label-col > .arco-form-item-label {
|
|
|
+:deep .arco-form-item-label-col>.arco-form-item-label {
|
|
|
display: none;
|
|
|
}
|
|
|
</style>
|