mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-29 10:04:44 +08:00
fix: config 不是 json 格式导致 dev 退出
This commit is contained in:
parent
f6c884eca0
commit
9137ffc61c
@ -125,7 +125,11 @@ const genRoutes = function (parentRoutes, path, parentRoutePath) {
|
||||
const routeMetaBlock = descriptor.customBlocks.find(
|
||||
b => b.type === 'config'
|
||||
);
|
||||
routeMeta = routeMetaBlock?.content ? JSON.parse(routeMetaBlock.content) : {};
|
||||
try {
|
||||
routeMeta = routeMetaBlock?.content ? JSON.parse(routeMetaBlock.content) : {};
|
||||
} catch (e) {
|
||||
console.warn(`config: ${routeMetaBlock.content} 必须为 json 格式`);
|
||||
}
|
||||
if (descriptor.script) {
|
||||
routeMeta = getRouteMeta(descriptor.script.content) || routeMeta;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user