mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 09:03:18 +08:00
fix(license): 让 License 信息的链接中不包含 params
- 避免 giscus 之类的敏感信息泄漏
This commit is contained in:
@@ -26,11 +26,18 @@ const postUrl = decodeURIComponent(Astro.url.toString());
|
||||
|
||||
<script>
|
||||
const currentLink = document.getElementById('current-link');
|
||||
const url = window.location.href;
|
||||
|
||||
currentLink.textContent = url; // 显示文本 = 当前 URL
|
||||
currentLink.href = url; // 点击跳转 = 当前 URL
|
||||
currentLink.style.display = 'inline'; // 显示出来
|
||||
if (currentLink) {
|
||||
console.log(`[license] old url: ${window.location.href}`);
|
||||
const url = new URL(window.location.href);
|
||||
url.search = '';
|
||||
const address = url.toString();
|
||||
console.log(`[license] new url: ${address}`);
|
||||
|
||||
currentLink.textContent = address; // 显示文本 = 当前 URL
|
||||
currentLink.href = address; // 点击跳转 = 当前 URL
|
||||
currentLink.style.display = 'inline'; // 显示出来
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex gap-6 mt-2">
|
||||
|
||||
Reference in New Issue
Block a user