上传新增文件

This commit is contained in:
2026-01-12 19:35:52 +08:00
parent fee5e2a6c0
commit d0c3fe5084
27 changed files with 64347 additions and 460 deletions

View File

@@ -156,13 +156,20 @@ export function dynamicImport(dynamicViewsModules: Record<string, Function>, com
const matchKeys = keys.filter((key) => {
const k = key.replace(/..\/views|../, '');
return k.startsWith(`${component}.vue`);
// 支持路径格式:/stuwork/weekPlan/index 或 stuwork/weekPlan/index
const normalizedComponent = component.startsWith('/') ? component : `/${component}`;
return k.startsWith(`${normalizedComponent}.vue`) || k.startsWith(`${component}.vue`);
});
if (matchKeys?.length === 1) {
const matchKey = matchKeys[0];
return dynamicViewsModules[matchKey];
}
if (matchKeys?.length > 1) {
console.warn(`Multiple matches found for component: ${component}`, matchKeys);
return false;
}
if (matchKeys?.length === 0) {
console.warn(`No match found for component: ${component}. Available keys:`, keys.slice(0, 10));
return false;
}
}