mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 修复1:: 形式的ipv6校验失败的bug
This commit is contained in:
@@ -27,8 +27,12 @@ function openWindow(url: string, options: OpenWindowOptions = {}): void {
|
||||
*/
|
||||
function openRouteInNewWindow(path: string) {
|
||||
const { hash, origin } = location;
|
||||
let pathname = location.pathname;
|
||||
if (pathname.endsWith("/")) {
|
||||
pathname = pathname.slice(0, -1);
|
||||
}
|
||||
const fullPath = path.startsWith("/") ? path : `/${path}`;
|
||||
const url = `${origin}${hash ? "/#" : ""}${fullPath}`;
|
||||
const url = `${origin}${pathname}${hash ? "/#" : ""}${fullPath}`;
|
||||
openWindow(url, { target: "_blank" });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user