mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: 兼容大写
This commit is contained in:
parent
c351829cf4
commit
4040f215d9
@ -50,7 +50,7 @@ const getRouteName = function (parentRoutePath, fileName) {
|
|||||||
.replace(/\//g, '_')
|
.replace(/\//g, '_')
|
||||||
.replace(/@/g, '_')
|
.replace(/@/g, '_')
|
||||||
.replace(/\*/g, 'FUZZYMATCH')
|
.replace(/\*/g, 'FUZZYMATCH')
|
||||||
.replace(/\[...([a-z]*)\]/, 'FUZZYMATCH-$1');
|
.replace(/\[...([a-zA-Z]*)\]/, 'FUZZYMATCH-$1');
|
||||||
};
|
};
|
||||||
|
|
||||||
const getRoutePath = function (parentRoutePath, fileName, isFile = true) {
|
const getRoutePath = function (parentRoutePath, fileName, isFile = true) {
|
||||||
@ -67,8 +67,8 @@ const getRoutePath = function (parentRoutePath, fileName, isFile = true) {
|
|||||||
fileName = fileName.replace('*', ':pathMatch(.*)');
|
fileName = fileName.replace('*', ':pathMatch(.*)');
|
||||||
}
|
}
|
||||||
// /[...slug].vue -> /:slug(.*)
|
// /[...slug].vue -> /:slug(.*)
|
||||||
if (/\[...[a-z]*\]/.test(fileName)) {
|
if (/\[...[a-zA-Z]*\]/.test(fileName)) {
|
||||||
fileName = fileName.replace(/\[...([a-z]*)\]/, ':$1(.*)').replace(':(.*)', ':pathMatch(.*)');
|
fileName = fileName.replace(/\[...([a-zA-Z]*)\]/, ':$1(.*)').replace(':(.*)', ':pathMatch(.*)');
|
||||||
}
|
}
|
||||||
return winPath(join(parentRoutePath, fileName));
|
return winPath(join(parentRoutePath, fileName));
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user