fixed 修复跳转bug
This commit is contained in:
1 parent
42533415a7
commit
c70835138f
3 files changed
+3
-2
No files matched your search
@@ -2,5 +2,6 @@
|
|||||||
title: "跳转页面"
|
title: "跳转页面"
|
||||||
date: 2024-08-03
|
date: 2024-08-03
|
||||||
layout: "tiaozhuan"
|
layout: "tiaozhuan"
|
||||||
|
url: "tiaozhuan.html"
|
||||||
draft: false
|
draft: false
|
||||||
---
|
---
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
{{ if or (in $url "www.usj.cc") (strings.HasPrefix $url "/") }}
|
{{ if or (in $url "www.usj.cc") (strings.HasPrefix $url "/") }}
|
||||||
href="{{ $url }}"
|
href="{{ $url }}"
|
||||||
{{ else }}
|
{{ else }}
|
||||||
href="/tiaozhuan/index.html?target={{ $url | base64Encode }}"
|
href="/tiaozhuan.html?target={{ $url | base64Encode }}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}
|
{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function checkParent(element, classNames) {
|
|||||||
target.hostname !== window.location.hostname) {
|
target.hostname !== window.location.hostname) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let encodedUrl = btoa(target.href); // Base64 encode the URL
|
let encodedUrl = btoa(target.href); // Base64 encode the URL
|
||||||
let url = '/tiaozhuan/index.html?target=' + encodedUrl;
|
let url = '/tiaozhuan.html?target=' + encodedUrl;
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user