From 02e1980387f37b2f4edda583f68d2dc9802c7d6d Mon Sep 17 00:00:00 2001 From: yaoyun8 Date: Sun, 10 Dec 2023 19:40:44 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DDSL=E5=87=BA=E7=A0=81?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vue-generator/src/utils/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/vue-generator/src/utils/index.js b/packages/vue-generator/src/utils/index.js index 9229f17d8c..e39e9f1003 100644 --- a/packages/vue-generator/src/utils/index.js +++ b/packages/vue-generator/src/utils/index.js @@ -33,7 +33,11 @@ const getFunctionInfo = (fnStr) => { return null } -const safeRandom = () => crypto.getRandomValues(new Uint32Array(1))[0] / (Math.pow(2, 32) - 1) +const safeRandom = () => { + const mathConstructor = Math + + return mathConstructor.random +} const randomString = (length = 4, chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') => { let result = ''