fix 修复全局属性找不到的问题

This commit is contained in:
ahao 2023-12-26 17:51:48 +08:00
parent 0433708a2e
commit f3be746e1d
7 changed files with 9 additions and 10 deletions

View File

@ -57,7 +57,8 @@
"@unocss/preset-attributify": "^0.58.0",
"@unocss/preset-icons": "^0.58.0",
"@unocss/preset-uno": "^0.58.0",
"@vue/compiler-sfc": "3.3.9",
"@vue/compiler-sfc": "3.3.11",
"@vue/runtime-core": "3.3.11",
"@vitejs/plugin-vue": "4.5.2",
"autoprefixer": "10.4.14",
"eslint": "8.55.0",

View File

@ -40,8 +40,6 @@ router.beforeEach(async (to, from, next) => {
router.addRoute(route); // 动态添加可访问路由表
}
});
const n = { ...to, replace: true };
console.log(n);
next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成
}
} else {

View File

@ -1,5 +1,4 @@
import axios from 'axios';
export {};
declare module 'axios' {
interface AxiosResponse<T = any> {
code: number;

View File

@ -1,5 +1,4 @@
import type { ComponentInternalInstance as ComponentInstance } from 'vue/runtime-core';
import type { PropType as VuePropType } from 'vue';
import type { PropType as VuePropType, ComponentInternalInstance as ComponentInstance } from 'vue';
import { LanguageEnum } from '@/enums/LanguageEnum';
declare global {

View File

@ -5,10 +5,12 @@ import auth from '@/plugins/auth';
import cache from '@/plugins/cache';
import animate from '@/animate';
import { useDict } from '@/utils/dict';
import handleTree, { addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi';
import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi';
import { getConfigKey, updateConfigByKey } from '@/api/system/config';
import { download as rd } from '@/utils/request';
export {};
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
// 全局方法声明

View File

@ -60,7 +60,7 @@ import { getAuthRole, updateAuthRole } from '@/api/system/user';
import { UserForm } from '@/api/system/user/types';
const route = useRoute();
const { proxy } = getCurrentInstance();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const loading = ref(true);
const total = ref(0);

View File

@ -306,7 +306,7 @@ import { to } from 'await-to-js';
import { globalHeaders } from '@/utils/request';
const router = useRouter();
const { proxy } = getCurrentInstance();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable, sys_user_sex } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_user_sex'));
const userList = ref<UserVO[]>();
const loading = ref(true);