From 9cd6f5ab0791fadf1ceb40f6fd6adbd3f5158784 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Fri, 20 Jun 2025 14:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/axios/service.ts | 21 ++-- frontend/src/router/index.ts | 8 +- frontend/src/views/system/manage/index.vue | 22 ++--- .../system/manage/organization/index.vue | 1 - .../system/userlogin/appframe_container.vue | 96 +++++++++---------- frontend/src/views/system/userlogin/frame.vue | 74 +++++++------- frontend/src/views/system/userlogin/login.vue | 29 +++--- 7 files changed, 114 insertions(+), 137 deletions(-) diff --git a/frontend/src/data-visualization/config/axios/service.ts b/frontend/src/data-visualization/config/axios/service.ts index 91c62a1..26ce1e1 100644 --- a/frontend/src/data-visualization/config/axios/service.ts +++ b/frontend/src/data-visualization/config/axios/service.ts @@ -65,12 +65,12 @@ const getTimeOut = () => { } // 创建axios实例 -const time = getTimeOut() -window._de_get_time_out = time +// const time = getTimeOut() +// window._de_get_time_out = time console.log('timeout', PATH_URL) const service: AxiosInstanceWithLoading = axios.create({ baseURL: PATH_URL, // api 的 base_url - timeout: time ? time * 1000 : config.request_timeout // 请求超时时间 + // timeout: time ? time * 1000 : config.request_timeout // 请求超时时间 }) const mapping = { 'zh-CN': 'zh-CN', @@ -152,14 +152,15 @@ service.interceptors.response.use( } else { if ( !response?.config?.url.startsWith('/xpackComponent/content') && - response?.data?.code !== 60003 + response?.data?.code !== 60003 ) { - ElMessage({ - type: 'error', - message: response.data.msg, - showClose: true - }) - + if(response?.data?.code != '1'){ + ElMessage({ + type: 'error', + message: response.data.msg, + showClose: true + }) + } if (response.data.code === 80001) { localStorage.clear() let queryRedirectPath = '/application/index' diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 11ce39a..a42cd8c 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -5,7 +5,7 @@ import { useUserStore } from '@/store/user' const routes:any = [ { path: '/', - redirect: '/dashboard' + redirect: '/UserNavbar' }, // 登录页面路由配置 { @@ -86,7 +86,7 @@ const routes:any = [ name: 'visualization', component: () => import('@/data-visualization/index.vue'), meta: { - title: '字典管理', + title: '数据大屏', requiresAuth: true } }, @@ -136,11 +136,9 @@ const router = createRouter({ // 路由守卫 router.beforeEach((to, from, next) => { const userStore = useUserStore() - // 设置页面标题 document.title = to.meta.title ? `${to.meta.title} - StdProject` : 'StdProject' const token = localStorage.getItem('token') || '' - console.log(userStore.isAuthenticated) // 检查是否需要认证 if (to.meta.requiresAuth) { if (!!token) { @@ -151,7 +149,7 @@ router.beforeEach((to, from, next) => { } else { // 如果已登录且访问登录页,重定向到仪表板 if (to.path === '/UserLogin' && userStore.isAuthenticated) { - next('/dashboard') + next('/UserNavbar') } else { next() } diff --git a/frontend/src/views/system/manage/index.vue b/frontend/src/views/system/manage/index.vue index 9a4fe08..a785124 100644 --- a/frontend/src/views/system/manage/index.vue +++ b/frontend/src/views/system/manage/index.vue @@ -11,26 +11,22 @@ const route = useRoute() const router = useRouter() const applicationId:any =ref("") const curmenu = ref('') -onMounted(() => { - if (route.query.id) { - applicationId.value = route.query.id - curmenu.value = '组织机构配置' - // findApplicationById(applicationId.value).then(res => { - // res.data.data.typename = '权限设置' - // projectInfo.value = res.data.data - // }) - }else{ - - } +const props = defineProps({ + isshowheader: Boolean }) -function menuclick(name){ +onMounted(() => { + const userInfo:any = JSON.parse(localStorage.getItem('userInfo')) + applicationId.value = userInfo.appid + curmenu.value = '组织机构配置' +}) +function menuclick(name:any){ curmenu.value = name }