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

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue';
import { ConfigProvider } from 'ant-design-vue';
import { ConfigProvider, StyleProvider } from 'ant-design-vue'; // 添加 StyleProvider
import { useAppStore } from './store/modules/app';
import { useThemeStore } from './store/modules/theme';
import { antdLocales } from './locales/antd';
@@ -20,9 +20,11 @@ const antdLocale = computed(() => {
<template>
<ConfigProvider :theme="themeStore.antdTheme" :locale="antdLocale">
<AppProvider>
<RouterView class="bg-layout" />
</AppProvider>
<StyleProvider hash-priority="high">
<AppProvider>
<RouterView class="bg-layout" />
</AppProvider>
</StyleProvider>
</ConfigProvider>
</template>

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();
}
});
}