From 60f1b7ebca0d832069e9811998610b8964a474e0 Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期五, 09 八月 2024 17:55:45 +0800 Subject: [PATCH] 优化知识库页面兼容性 --- src/views/login/components/login-form.vue | 53 ++++++++++++++++++++++++----------------------------- 1 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/views/login/components/login-form.vue b/src/views/login/components/login-form.vue index 02b12da..583ef10 100644 --- a/src/views/login/components/login-form.vue +++ b/src/views/login/components/login-form.vue @@ -1,7 +1,7 @@ <template> <div class="login-form-wrapper"> <div class="login-form-title">{{ $t('login.form.title') }}</div> -<!-- <div class="login-form-sub-title">{{ $t('login.form.title') }}</div>--> + <!-- <div class="login-form-sub-title">{{ $t('login.form.title') }}</div>--> <div class="login-form-error-msg">{{ errorMessage }}</div> <a-form ref="loginForm" @@ -16,10 +16,7 @@ :validate-trigger="['change', 'blur']" hide-label > - <a-input - v-model="userInfo.email" - placeholder="璇疯緭鍏ラ偖绠�" - > + <a-input v-model="userInfo.email" placeholder="璇疯緭鍏ラ偖绠�"> <template #prefix> <icon-user /> </template> @@ -43,28 +40,28 @@ </a-form-item> <a-space :size="16" direction="vertical"> <div class="login-form-password-actions"> - <a-checkbox + <!-- <a-checkbox checked="rememberPassword" :model-value="loginConfig.rememberPassword" @change="setRememberPassword as any" > {{ $t('login.form.rememberPassword') }} - </a-checkbox> - <a-link>{{ $t('login.form.forgetPassword') }}</a-link> + </a-checkbox> --> + <!-- <a-link>{{ $t("login.form.forgetPassword") }}</a-link> --> </div> <a-button type="primary" html-type="submit" long :loading="loading"> {{ $t('login.form.login') }} </a-button> - <a-button type="text" long class="login-form-register-btn"> + <!-- <a-button type="text" long class="login-form-register-btn"> {{ $t('login.form.register') }} - </a-button> + </a-button> --> </a-space> </a-form> </div> </template> <script lang="ts" setup> - import { ref, reactive } from 'vue'; + import { reactive, ref } from 'vue'; import { useRouter } from 'vue-router'; import { Message } from '@arco-design/web-vue'; import { ValidatedError } from '@arco-design/web-vue/es/form/interface'; @@ -83,12 +80,12 @@ const loginConfig = useStorage('login-config', { rememberPassword: true, - email: '1750082535@qq.com', // 婕旂ず榛樿鍊� - password: 'basic2024', // demo default value + email: '', // 婕旂ず榛樿鍊� + password: '', // demo default value }); const userInfo = reactive({ - email: '1750082535@qq.com', // 婕旂ず榛樿鍊� - password: 'basic2024', // demo default value + email: '', // 婕旂ず榛樿鍊� + password: '', // demo default value }); const handleSubmit = async ({ @@ -102,28 +99,26 @@ if (!errors) { setLoading(true); try { - // const rsaPassWord = rsaPsw(values.password) as string; - // console.log(values,'鐧诲綍淇℃伅'); - // await userStore.login({ - // email: values.email, - // password: rsaPassWord, - // } as LoginData); - // const { redirect, ...othersQuery } = router.currentRoute.value.query; + const rsaPassWord = rsaPsw(values.password) as string; + console.log(values, '鐧诲綍淇℃伅'); + let goto = await userStore.login({ + email: values.email, + password: rsaPassWord, + } as LoginData); + const { redirect, ...othersQuery } = router.currentRoute.value.query; router.push({ - name: 'knowledgeLib', - // query: { - // ...othersQuery, - // }, + name: goto, + query: { + ...othersQuery, + }, }); - Message.success(t('娆㈣繋鍥炴潵')); + Message.success(t('鐧诲綍鎴愬姛')); const { rememberPassword } = loginConfig.value; const { email, password } = values; // 瀹為檯鐢熶骇鐜闇�瑕佽繘琛屽姞瀵嗗瓨鍌ㄣ�� // The actual production environment requires encrypted storage. loginConfig.value.email = rememberPassword ? email : ''; loginConfig.value.password = rememberPassword ? password : ''; - - } catch (err) { errorMessage.value = (err as Error).message; } finally { -- Gitblit v1.8.0