|
|
@@ -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>
|
|
|
@@ -88,6 +78,10 @@ const handleSubmit = (data) => {
|
|
|
.toLogin({ username: data.username, password: data.password })
|
|
|
.then((res) => {
|
|
|
$message.success(res);
|
|
|
+
|
|
|
+ // 登录成功后,获取用户权限
|
|
|
+ userStore.getUserInfo()
|
|
|
+
|
|
|
router.push({ path: '/knowledge' });
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
@@ -130,6 +124,7 @@ const changeFormType = (e) => {
|
|
|
font-size: 30px;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
+
|
|
|
.submit-btn {
|
|
|
width: 100%;
|
|
|
height: 54px;
|
|
|
@@ -138,10 +133,12 @@ const changeFormType = (e) => {
|
|
|
font-size: 20px;
|
|
|
border-radius: 3px;
|
|
|
}
|
|
|
+
|
|
|
.submit-btn:hover {
|
|
|
background-color: rgba(var(--arcoblue-6), 0.8);
|
|
|
color: var(--color-neutral-1);
|
|
|
}
|
|
|
+
|
|
|
.tips-register {
|
|
|
position: absolute;
|
|
|
right: 20px;
|
|
|
@@ -149,6 +146,7 @@ const changeFormType = (e) => {
|
|
|
font-size: 20px;
|
|
|
color: var(--color-neutral-4);
|
|
|
}
|
|
|
+
|
|
|
.reg-link {
|
|
|
color: rgb(var(--arcoblue-6));
|
|
|
}
|
|
|
@@ -156,12 +154,14 @@ const changeFormType = (e) => {
|
|
|
.arco-form-item-label-col {
|
|
|
padding: 0px;
|
|
|
}
|
|
|
+
|
|
|
.arco-input-wrapper {
|
|
|
height: 54px;
|
|
|
background-color: var(--color-bg-1);
|
|
|
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>
|