mirror of https://github.com/jeecgboot/jeecg-boot
Merge c17567ac9f
into fd60e49f5b
commit
3ee4f52014
|
@ -57,6 +57,26 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
|
||||||
}
|
}
|
||||||
// @ts-ignore 添加是否缓存路由配置
|
// @ts-ignore 添加是否缓存路由配置
|
||||||
item.meta.ignoreKeepAlive = !item?.meta.keepAlive;
|
item.meta.ignoreKeepAlive = !item?.meta.keepAlive;
|
||||||
|
|
||||||
|
// 处理路径中的query参数 - 核心修复
|
||||||
|
if (item.path && item.path.includes('?')) {
|
||||||
|
const [basePath, queryString] = item.path.split('?');
|
||||||
|
item.path = basePath; // 只保留基础路径作为Vue Router的path
|
||||||
|
|
||||||
|
// 将query参数保存到meta中,供菜单点击时使用
|
||||||
|
if (queryString) {
|
||||||
|
const queryParams: Record<string, string> = {};
|
||||||
|
queryString.split('&').forEach((param) => {
|
||||||
|
const [key, value] = param.split('=');
|
||||||
|
if (key) {
|
||||||
|
queryParams[decodeURIComponent(key)] = decodeURIComponent(value || '');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
item.meta = item.meta || {};
|
||||||
|
item.meta.queryParams = queryParams;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let token = getToken();
|
let token = getToken();
|
||||||
let tenantId = getTenantId();
|
let tenantId = getTenantId();
|
||||||
// URL支持{{ window.xxx }}占位符变量
|
// URL支持{{ window.xxx }}占位符变量
|
||||||
|
|
Loading…
Reference in New Issue