fix: add legacy browser support
This commit is contained in:
parent
dc2f094b6f
commit
8e3274b0d5
3
components.d.ts
vendored
3
components.d.ts
vendored
@ -12,7 +12,6 @@ declare module 'vue' {
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDrawer: (typeof import('element-plus/es'))['ElDrawer']
|
||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||
@ -20,9 +19,7 @@ declare module 'vue' {
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: (typeof import('element-plus/es'))['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElInputNumber: (typeof import('element-plus/es'))['ElInputNumber']
|
||||
ElMain: typeof import('element-plus/es')['ElMain']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
|
11
package.json
11
package.json
@ -6,7 +6,8 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"preview:build": "vite build --watch",
|
||||
"preview:run": "vite preview --host 0.0.0.0 --port 18081",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build --force",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||
@ -28,14 +29,17 @@
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.26.0",
|
||||
"@babel/preset-env": "^7.26.0",
|
||||
"@iconify-json/ep": "^1.2.1",
|
||||
"@rushstack/eslint-patch": "^1.10.4",
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.17.9",
|
||||
"@vitejs/plugin-legacy": "^6.0.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"@vue/eslint-config-prettier": "^8.0.0",
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"@vue/tsconfig": "^0.5.1",
|
||||
@ -44,11 +48,12 @@
|
||||
"npm-run-all2": "^6.2.6",
|
||||
"prettier": "^3.4.2",
|
||||
"sass": "^1.82.0",
|
||||
"terser": "^5.37.0",
|
||||
"typescript": "^5.7.2",
|
||||
"unplugin-auto-import": "^0.17.8",
|
||||
"unplugin-icons": "^0.18.5",
|
||||
"unplugin-vue-components": "^0.26.0",
|
||||
"vite": "^5.4.11",
|
||||
"vite": "^6.0.0",
|
||||
"vue-tsc": "^1.8.27"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
|
12
src/App.vue
12
src/App.vue
@ -364,7 +364,7 @@ import { loginResponseSchema, registerResponseSchema } from '@/schemas';
|
||||
import { useUserStore } from '@/stores';
|
||||
import { usePageStore } from '@/stores/page';
|
||||
import { arrayIncludes, errorMessage } from '@/utils';
|
||||
import { Avatar, CloseBold, UserFilled } from '@element-plus/icons-vue';
|
||||
import { Avatar, CloseBold } from '@element-plus/icons-vue';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus';
|
||||
import { partial } from 'lodash-es';
|
||||
@ -396,7 +396,7 @@ watch(showLoginRegisterDialog, (value) => {
|
||||
});
|
||||
const loginRegisterDialogActiveName = ref('login');
|
||||
const loginFormRef = ref<FormInstance>();
|
||||
const loginFormData = reactive({
|
||||
let loginFormData = reactive({
|
||||
username: 'wubaopu2',
|
||||
password: '123456',
|
||||
verifyImage: 'none' as VerifyImagePath,
|
||||
@ -418,7 +418,7 @@ const loginFormRules = reactive<FormRules<typeof loginFormData>>({
|
||||
});
|
||||
const logining = ref(false);
|
||||
const registerFormRef = ref<FormInstance>();
|
||||
const registerFormData = reactive({
|
||||
let registerFormData = reactive({
|
||||
username: '',
|
||||
password: '',
|
||||
confirmPassword: '',
|
||||
@ -479,7 +479,7 @@ async function submitLoginForm() {
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
if (typeof loginFormData.verifyImage === 'string') {
|
||||
if (typeof loginFormData.verifyImage !== 'object') {
|
||||
ElMessage.error('请获取验证码');
|
||||
return;
|
||||
}
|
||||
@ -543,7 +543,7 @@ async function submitRegisterForm() {
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
if (typeof registerFormData.verifyImage === 'string') {
|
||||
if (typeof registerFormData.verifyImage !== 'object') {
|
||||
ElMessage.error('请输入验证码');
|
||||
return;
|
||||
}
|
||||
@ -557,7 +557,7 @@ async function submitRegisterForm() {
|
||||
} finally {
|
||||
if (succeed) {
|
||||
userStore.userInfoStatus = 'uninitialized';
|
||||
router.push({ path: route.fullPath, force: true });
|
||||
await router.push({ path: route.fullPath, force: true });
|
||||
} else {
|
||||
registerFormData.verifyImage = 'none';
|
||||
registerFormRef.value?.resetFields('verifyCode');
|
||||
|
@ -1,5 +1,6 @@
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import legacy from "@vitejs/plugin-legacy";
|
||||
import { resolve } from 'node:path';
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
|
||||
@ -11,6 +12,9 @@ import { defineConfig } from 'vite';
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
legacy({
|
||||
targets: ['defaults'],
|
||||
}),
|
||||
vue(),
|
||||
vueJsx(),
|
||||
AutoImport({
|
||||
|
Loading…
x
Reference in New Issue
Block a user