From 1fbdff1be0010f8e73264db6c1e5da9878a9cd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Thu, 30 Mar 2023 16:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E5=BA=93=E7=AE=A1=E7=90=86=E7=9A=84id=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/CollectionType/index.vue | 15 +++++++++++-- .../CollectionTypeDisabled/index.vue | 22 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/jero-web/src/components/CollectionType/index.vue b/jero-web/src/components/CollectionType/index.vue index 21fee26a9..b00044d8c 100644 --- a/jero-web/src/components/CollectionType/index.vue +++ b/jero-web/src/components/CollectionType/index.vue @@ -966,8 +966,19 @@ } }) }, - generateRandom() { - return Math.random().toString(32) + generateRandom(size = 16) { + let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' + + let id = '' + // A compact alternative for `for (var i = 0; i < step; i++)`. + let i = size + while (i--) { + // `| 0` is more compact and faster than `Math.floor()`. + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id + // return Math.random().toString(32) }, addconfig() { let paramsConfigData = Object.keys(this.detailDate.paramsConfigData) diff --git a/jero-web/src/components/CollectionTypeDisabled/index.vue b/jero-web/src/components/CollectionTypeDisabled/index.vue index 8369d66cd..d37359513 100644 --- a/jero-web/src/components/CollectionTypeDisabled/index.vue +++ b/jero-web/src/components/CollectionTypeDisabled/index.vue @@ -728,8 +728,8 @@ -
+
{ if (res.type === 'pull_more') {