From 9e2f7344c92d5a5ea2b7af80d72d25c6fcde087a Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Mon, 12 Jan 2026 09:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 4 ++-- .../DesignForm/tableListPage/index.vue | 2 +- src/store/modules/orgMember.ts | 6 +++++- src/utils/request.ts | 19 +++++++++++++------ src/utils/requestfile.ts | 17 ++++++++++------- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index b591429..aa1b2d0 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -2287,9 +2287,9 @@ const isObject = (obj: any) => { diff --git a/src/components/DesignForm/tableListPage/index.vue b/src/components/DesignForm/tableListPage/index.vue index 494dc1a..8b4d872 100644 --- a/src/components/DesignForm/tableListPage/index.vue +++ b/src/components/DesignForm/tableListPage/index.vue @@ -2033,7 +2033,7 @@ const isObject = (obj: any) => { type="primary" size="small" class="fa fa-print" - @click="printPage(scope.row)" + /> diff --git a/src/store/modules/orgMember.ts b/src/store/modules/orgMember.ts index 69709ab..48f4e0b 100644 --- a/src/store/modules/orgMember.ts +++ b/src/store/modules/orgMember.ts @@ -27,13 +27,17 @@ export const useOrgMemberStore = defineStore('orgMember', () => { } function handleChildren(childs:any[]){ + if(childs.length> 0){ + + childs.forEach(item => { listMap.value[item.id] = item.name; if(item.child){ handleChildren(item.child) } }); + } } init() return { listMap,dataTree } -}) \ No newline at end of file +}) diff --git a/src/utils/request.ts b/src/utils/request.ts index 1fc8d20..9566003 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,7 +1,11 @@ import axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios'; import { useUserStoreHook } from '@/store/modules/user'; import { ElMessage, ElMessageBox } from 'element-plus'; +import router from '@/router'; +import { useRouter } from 'vue-router' + +const routerPinia = useRouter() // 创建 axios 实例 const service = axios.create({ baseURL: import.meta.env.VITE_APP_BASE_API, @@ -38,12 +42,13 @@ service.interceptors.response.use( return response.data; } if (code === 7 || code === 300 || code === 301 || code === 302){ - ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示", { + ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示5", { confirmButtonText: "确定", type: "warning", }).then(() => { localStorage.clear(); - window.location.href = "/"; + // window.location.href = "/login"; + routerPinia.push({path:"/login"}) }); return response.data; } @@ -60,20 +65,22 @@ service.interceptors.response.use( const { code, msg } = error.response.data; // token 过期,重新登录 if (code === 'A0230') { - ElMessageBox.confirm('当前页面已失效,请重新登录', '提示', { + ElMessageBox.confirm('当前页面已失效,请重新登录', '提示6', { confirmButtonText: '确定', type: 'warning' }).then(() => { localStorage.clear(); - window.location.href = '/'; + // window.location.href = '/login'; + router.push({path:"/login"}) }); }else if(code === 7 || code === 300 || code === 301 || code === 302){ - ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示", { + ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示7", { confirmButtonText: "确定", type: "warning", }).then(() => { localStorage.clear(); - window.location.href = "/"; + // window.location.href = "/login"; + routerPinia.push({path:"/login"}) }); }else if (code === 10001 || code === 10002 || code === 10003) { return Promise.reject(error.message); diff --git a/src/utils/requestfile.ts b/src/utils/requestfile.ts index 963b889..8602fe3 100644 --- a/src/utils/requestfile.ts +++ b/src/utils/requestfile.ts @@ -1,7 +1,8 @@ import axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios'; import { useUserStoreHook } from '@/store/modules/user'; import { ElMessage, ElMessageBox } from 'element-plus'; - +import { useRouter } from 'vue-router' +const routerPinia = useRouter() // 创建 axios 实例 const service = axios.create({ baseURL: import.meta.env.VITE_APP_BASE_API, @@ -36,12 +37,13 @@ service.interceptors.response.use( return response.data; } if (code === 7 || code === 300 || code === 301 || code === 302){ - ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示", { + ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示3", { confirmButtonText: "确定", type: "warning", }).then(() => { localStorage.clear(); - window.location.href = "/"; + // window.location.href = "/login"; + routerPinia.push({path:"/login"}) }); return response.data; } @@ -58,20 +60,21 @@ service.interceptors.response.use( const { code, msg } = error.response.data; // token 过期,重新登录 if (code === 'A0230') { - ElMessageBox.confirm('当前页面已失效,请重新登录', '提示', { + ElMessageBox.confirm('当前页面已失效,请重新登录', '提示1', { confirmButtonText: '确定', type: 'warning' }).then(() => { localStorage.clear(); - window.location.href = '/'; + window.location.href = '/login'; }); }else if(code === 7 || code === 300 || code === 301 || code === 302){ - ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示", { + ElMessageBox.confirm("身份令牌已失效!请重新登录!", "提示2", { confirmButtonText: "确定", type: "warning", }).then(() => { localStorage.clear(); - window.location.href = "/"; + // window.location.href = "/login"; + routerPinia.push({path:"/login"}) }); }else if (code === 10001 || code === 10002 || code === 10003) { return Promise.reject(error.message);