fix: webui 随机token仅生成不会被url编码的随机字符

This commit is contained in:
时瑾 2026-01-30 18:25:10 +08:00
parent b0cc7b6ee5
commit 0f132a5972
No known key found for this signature in database
GPG Key ID: 023F70A1B8F8C196

View File

@ -180,7 +180,7 @@ const GenericForm = <T extends keyof NetworkConfigType> ({
export default GenericForm;
export function random_token (length: number) {
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?';
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~';
let result = '';
for (let i = 0; i < length; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));