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 @@ -