feat(projects): 增加项目文档外链

This commit is contained in:
Yanbowen
2021-12-20 14:04:11 +08:00
parent 041012b3ee
commit 1901a0bfb7
5 changed files with 33 additions and 2 deletions

View File

@ -47,3 +47,10 @@ export function transformRouteToMenu(routes: RouteRecordRaw[]) {
});
return globalMenu;
}
/** 判断路由是否为Url链接 */
export function isUrl(path: string): boolean {
const reg =
/(((^https?:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
return reg.test(path);
}