update 平台配置页面

This commit is contained in:
2024-04-23 16:09:56 +08:00
parent 866daa6121
commit 4bfe6acc49
3 changed files with 141 additions and 15 deletions

View File

@@ -251,3 +251,16 @@ export function getYear() {
let nowDate = new Date();
return nowDate.getFullYear();
}
// 随机字符串
export function generateRandomID(length) {
// const characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
// const idLength = 30; // 字符串长度 这里生成30位的
let randomID = '';
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
randomID += characters.charAt(randomIndex);
}
return randomID;
}