From 4bfe6acc49cf74c60544cde22ea6c7cc2cfc3b67 Mon Sep 17 00:00:00 2001 From: Guoqs Date: Tue, 23 Apr 2024 16:09:56 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=B9=B3=E5=8F=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsowell-ui/src/utils/common.js | 13 +++ .../src/views/thirdparty/secret/detail.vue | 50 ++++++++-- .../src/views/thirdparty/secret/index.vue | 93 +++++++++++++++++-- 3 files changed, 141 insertions(+), 15 deletions(-) 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 @@