Commit ff5d35f8 authored by 前端-许佳敏's avatar 前端-许佳敏

chore: 处理菜单校验在windows下的路径错误

parent 5c0973cb
......@@ -16,7 +16,7 @@ function validateRouterJson(json, testLocalJson) {
// 本地的json
while(dispatchs.length) {
const item = dispatchs.shift()
hashMapReSource[item.replace(process.cwd(), '')] = true
hashMapReSource['/' + item.substring(item.indexOf('src')).replace(/\\/g, '/')] = true
dispatchs.push(...dispatchDir(item, excludes))
}
}
......@@ -25,7 +25,7 @@ function validateRouterJson(json, testLocalJson) {
function transformJson(json) {
return Array.isArray(json) ? json.reduce((target, maps) => {
if (maps.component) {
target[maps.component.replace('@', resourcePath).replace('./', resourcePath + '/pages/').replace(process.cwd(), '')] = true
target[maps.component.replace('@', '/src').replace('./', '/src/pages/')] = true
}
if (maps.routes) {
target = Object.assign(target, transformJson(maps.routes))
......
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