!2 fix: 正则表达式 代码中没有使用捕获组问题

Merge pull request !2 from simple/div
This commit is contained in:
simple
2024-08-12 20:36:20 +00:00
committed by 玲娜贝er
parent 85ab87fae1
commit 16a21e084e
3 changed files with 2 additions and 10 deletions

View File

@@ -121,7 +121,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
// 外链: http开头 & 组件为Layout || ParentView
// 正则判断是否为http://或者https://开头
if (
/^http(s)?:\/\//.test(menu.path) &&
/^https?:\/\//.test(menu.path) &&
(menu.component === 'Layout' || menu.component === 'ParentView')
) {
menu.component = 'Link';