2
0

fix:样式下调:where选择器

This commit is contained in:
zhongzm
2024-12-26 18:35:30 +08:00
parent 5ea674bc00
commit cafca0ec11
2 changed files with 25 additions and 10 deletions

View File

@@ -5,12 +5,23 @@ 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 { sessionStg } from '@/utils/storage';
// Add interface for check code response
interface CheckCodeResponse {
uuid: string;
img: string;
text?: string; // Make text optional since it might not always be present
text?: string;
}
// Add interface for LoginForm
interface LoginForm {
username: string;
password: string;
code: string;
uuid: string;
authType: string;
wanfiRedirectParams: Record<string, any>;
}
defineOptions({
@@ -26,7 +37,7 @@ const codeImg = ref('');
getCheckCode();
const model = reactive({
const model = reactive<LoginForm>({
username: '123456',
password: '123456',
code: '',
@@ -41,12 +52,14 @@ const rules = {
};
async function handleSubmit() {
await validate();//验证表单内容
model.wanfiRedirectParams = sessionStg.get('wanfiRedirectParams');
await validate();
const redirectParams = sessionStg.get('wanfiRedirectParams');
model.wanfiRedirectParams = redirectParams ? JSON.parse(redirectParams) : {};
await authStore.login({
loginForm: model, //发送表单的数据
loginForm: model,
onError() {
getCheckCode();//重新获取验证码
getCheckCode();
}
});
}