2
0

feat: 门户拦截定向跳转

This commit is contained in:
TsMask
2024-12-06 21:28:43 +08:00
parent 222ecc7558
commit 2c9d6e4e07
8 changed files with 104 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ import { loginModuleRecord } from '@/constants/app';
import { useRouterPush } from '@/hooks/common/router';
import { useAntdForm, useFormRules } from '@/hooks/common/form';
import { useAuthStore } from '@/store/modules/auth';
import {useI18n} from "vue-i18n";
import { useI18n } from "vue-i18n";
// Add interface for check code response
interface CheckCodeResponse {
@@ -16,6 +16,7 @@ interface CheckCodeResponse {
defineOptions({
name: 'PwdLogin'
});
const { t } = useI18n();
const authStore = useAuthStore();
const { toggleLoginModule } = useRouterPush();
@@ -23,7 +24,6 @@ const { formRef, validate } = useAntdForm();
const { patternRules } = useFormRules();
const codeImg = ref('');
getCheckCode();
const model = reactive({
@@ -31,7 +31,8 @@ const model = reactive({
password: '123456',
code: '',
uuid: '',
authType: 'u'
authType: 'u',
wanfiRedirectParams: {}
});
const rules = {
@@ -41,8 +42,9 @@ const rules = {
async function handleSubmit() {
await validate();//验证表单内容
model.wanfiRedirectParams = sessionStg.get('wanfiRedirectParams');
await authStore.login({
loginForm: model,//发送表单的数据
loginForm: model, //发送表单的数据
onError() {
getCheckCode();//重新获取验证码
}