mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-29 18:09:17 +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(
|
const routeMetaBlock = descriptor.customBlocks.find(
|
||||||
b => b.type === 'config'
|
b => b.type === 'config'
|
||||||
);
|
);
|
||||||
|
try {
|
||||||
routeMeta = routeMetaBlock?.content ? JSON.parse(routeMetaBlock.content) : {};
|
routeMeta = routeMetaBlock?.content ? JSON.parse(routeMetaBlock.content) : {};
|
||||||
|
} catch (e) {
|
||||||
|
console.warn(`config: ${routeMetaBlock.content} 必须为 json 格式`);
|
||||||
|
}
|
||||||
if (descriptor.script) {
|
if (descriptor.script) {
|
||||||
routeMeta = getRouteMeta(descriptor.script.content) || routeMeta;
|
routeMeta = getRouteMeta(descriptor.script.content) || routeMeta;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user