mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 平台配置页面
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user