Commit dc1cde9c authored by wanghao's avatar wanghao

1 进入管理系统 强制刷新界面调整

parent 0fa4f6fb
...@@ -34,7 +34,7 @@ export const constantRoutes = [ ...@@ -34,7 +34,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: '/redirect/:path(.*)', path: '/redirect/:path(.*)',
component: (resolve) => require(['@/views/redirect'], resolve) component: (resolve) => import(['@/views/redirect'], resolve)
} }
] ]
}, },
...@@ -42,31 +42,32 @@ export const constantRoutes = [ ...@@ -42,31 +42,32 @@ export const constantRoutes = [
path: '/bigScreen', path: '/bigScreen',
name: 'Screen', name: 'Screen',
component: () => import('@/views/screen/index.vue'), component: () => import('@/views/screen/index.vue'),
meta: { title: '数据看板界面' } meta: { title: '数据看板界面' , noCache: true}
}, },
{ {
path: '/login', path: '/login',
component: (resolve) => require(['@/views/login'], resolve), component: (resolve) => import(['@/views/login'], resolve),
hidden: true hidden: true
}, },
{ {
path: '/404', path: '/404',
component: (resolve) => require(['@/views/error/404'], resolve), component: (resolve) => import(['@/views/error/404'], resolve),
hidden: true hidden: true
}, },
{ {
path: '/401', path: '/401',
component: (resolve) => require(['@/views/error/401'], resolve), component: (resolve) => import(['@/views/error/401'], resolve),
hidden: true hidden: true
}, },
// 避免空路径,使用明确的路径
{ {
path: '', path: '/',
component: Layout, component: Layout,
redirect: 'index', redirect: '/index',
children: [ children: [
{ {
path: 'index', path: 'index',
component: (resolve) => require(['@/views/index'], resolve), component: () => import('@/views/index'),
name: '首页', name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
} }
...@@ -80,7 +81,7 @@ export const constantRoutes = [ ...@@ -80,7 +81,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'profile', path: 'profile',
component: (resolve) => require(['@/views/system/user/profile/index'], resolve), component: (resolve) => import(['@/views/system/user/profile/index'], resolve),
name: 'Profile', name: 'Profile',
meta: { title: '个人中心', icon: 'user' } meta: { title: '个人中心', icon: 'user' }
} }
...@@ -93,7 +94,7 @@ export const constantRoutes = [ ...@@ -93,7 +94,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'type/data/:dictId(\\d+)', path: 'type/data/:dictId(\\d+)',
component: (resolve) => require(['@/views/system/dict/data'], resolve), component: (resolve) => import(['@/views/system/dict/data'], resolve),
name: 'Data', name: 'Data',
meta: { title: '字典数据', icon: '' } meta: { title: '字典数据', icon: '' }
} }
...@@ -106,7 +107,7 @@ export const constantRoutes = [ ...@@ -106,7 +107,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'log', path: 'log',
component: (resolve) => require(['@/views/monitor/job/log'], resolve), component: (resolve) => import(['@/views/monitor/job/log'], resolve),
name: 'JobLog', name: 'JobLog',
meta: { title: '调度日志' } meta: { title: '调度日志' }
} }
...@@ -119,7 +120,7 @@ export const constantRoutes = [ ...@@ -119,7 +120,7 @@ export const constantRoutes = [
children: [ children: [
{ {
path: 'edit/:tableId(\\d+)', path: 'edit/:tableId(\\d+)',
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), component: (resolve) => import(['@/views/tool/gen/editTable'], resolve),
name: 'GenEdit', name: 'GenEdit',
meta: { title: '修改生成配置' } meta: { title: '修改生成配置' }
} }
......
...@@ -126,27 +126,19 @@ export default { ...@@ -126,27 +126,19 @@ export default {
this.selectedMenu = index; this.selectedMenu = index;
}, },
goToAdmin() { goToAdmin() {
// 方法1:使用完全不同的路径 console.log('当前路由:', this.$route);
const timestamp = Date.now(); console.log('目标路由: /index');
const random = Math.random().toString(36).substring(2); console.log('完整URL:', window.location.href);
// 先清除可能的DataV影响
// 创建一个临时iframe来清理环境 const dvContainers = document.querySelectorAll('.dv-full-screen-container');
const iframe = document.createElement('iframe'); dvContainers.forEach(container => container.remove());
iframe.style.display = 'none';
iframe.src = '/cleanup.html?t=' + timestamp; // 创建一个简单的清理页面 // 直接使用绝对路径跳转,避免路由问题
const baseUrl = window.location.origin;
iframe.onload = () => { const targetUrl = `${baseUrl}/index?refresh=${Date.now()}&r=${Math.random()}`;
// 使用replaceState改变当前URL,然后跳转
window.history.replaceState(null, '', '/redirect?t=' + timestamp); // 使用location.assign确保浏览器处理重定向
window.location.assign(targetUrl);
// 延迟跳转确保状态更新
setTimeout(() => {
// 使用assign而不是href,确保浏览器处理重定向
window.location.assign('/index?t=' + timestamp + '&r=' + random);
}, 50);
};
document.body.appendChild(iframe);
}, },
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment