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 }