From f3be746e1df56a481a4c8e01fe607996a86e9c06 Mon Sep 17 00:00:00 2001 From: ahao Date: Tue, 26 Dec 2023 17:51:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=89=BE=E4=B8=8D=E5=88=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/permission.ts | 2 -- src/types/axios.d.ts | 3 +-- src/types/global.d.ts | 3 +-- src/types/module.d.ts | 4 +++- src/views/system/user/authRole.vue | 2 +- src/views/system/user/index.vue | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 3b1c1d6..aec69c0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/permission.ts b/src/permission.ts index 69795f8..ef9976a 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -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 { diff --git a/src/types/axios.d.ts b/src/types/axios.d.ts index 2451f2a..9f2c6d2 100644 --- a/src/types/axios.d.ts +++ b/src/types/axios.d.ts @@ -1,5 +1,4 @@ -import axios from 'axios'; - +export {}; declare module 'axios' { interface AxiosResponse { code: number; diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 10cc438..17476a3 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -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 { diff --git a/src/types/module.d.ts b/src/types/module.d.ts index 16b1116..bc2f16b 100644 --- a/src/types/module.d.ts +++ b/src/types/module.d.ts @@ -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 { // 全局方法声明 diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue index 9ab08e5..b661811 100644 --- a/src/views/system/user/authRole.vue +++ b/src/views/system/user/authRole.vue @@ -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); diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index a952954..2de26a5 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -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(proxy?.useDict('sys_normal_disable', 'sys_user_sex')); const userList = ref(); const loading = ref(true);