Skip to content

Commit bfe29b3

Browse files
authored
Update redirect-koa-cn-apk.html
1 parent f8c616c commit bfe29b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

redirect-koa-cn-apk.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<meta charset="UTF-8" />
55
<title>重定向地址获取</title>
66
<script>
7-
const version = '1.0.2'; // 版本号
7+
const version = '1.0.3'; // 版本号
88
const targetUrl = 'https://koa-download.kingsgroup.cn/koa.apk';
9-
const redirectDiv = document.querySelector('#redirect'); // 使用 querySelector 确保 redirectDiv 存在
9+
const redirectDiv = document.getElementById('redirect'); // 使用 getElementById 确保 redirectDiv 存在
1010

1111
// 获取重定向地址
1212
async function getRedirectUrl() {
@@ -24,11 +24,11 @@
2424

2525
// 更新网页显示
2626
if (redirectDiv) {
27-
redirectDiv.innerHTML = `重定向地址:${redirectUrl}`;
27+
redirectDiv.textContent = `重定向地址:${redirectUrl}`; // 使用 textContent 避免注入攻击
2828
}
2929
} catch (error) {
3030
if (redirectDiv) {
31-
redirectDiv.innerHTML = `获取重定向地址失败:${error}`;
31+
redirectDiv.textContent = `获取重定向地址失败:${error}`; // 使用 textContent 避免注入攻击
3232
}
3333
}
3434
}

0 commit comments

Comments
 (0)