Commit dc1cde9c authored by wanghao's avatar wanghao

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

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