保存规则库 YAML 维护改造进展

This commit is contained in:
2026-04-28 22:00:00 +08:00
parent 7b86293263
commit dce5ac0c9a
96 changed files with 36801 additions and 615 deletions
+15
View File
@@ -0,0 +1,15 @@
const permissionRouteAliases: Array<[RegExp, string]> = [
[/^\/reviewsTest(?=\/|$)/, '/reviews'],
[/^\/rulesTest\/list(?=\/|$)/, '/rules/list'],
[/^\/rulesTest\/detail(?=\/|$)/, '/rules/new'],
];
export function normalizeRoutePathForPermission(pathname: string): string {
for (const [pattern, replacement] of permissionRouteAliases) {
if (pattern.test(pathname)) {
return pathname.replace(pattern, replacement);
}
}
return pathname;
}