diff --git a/jsowell-ui/src/utils/common.js b/jsowell-ui/src/utils/common.js index 7e237ac2a..0c52b71cc 100644 --- a/jsowell-ui/src/utils/common.js +++ b/jsowell-ui/src/utils/common.js @@ -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; +} diff --git a/jsowell-ui/src/views/thirdparty/secret/detail.vue b/jsowell-ui/src/views/thirdparty/secret/detail.vue index b0c983752..28b73d519 100644 --- a/jsowell-ui/src/views/thirdparty/secret/detail.vue +++ b/jsowell-ui/src/views/thirdparty/secret/detail.vue @@ -1,7 +1,7 @@