From af3989a02e6f2cd1fc8f04df2e618380286bfb5b Mon Sep 17 00:00:00 2001 From: yaoyun8 <142570291+yaoyun8@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:16:16 +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=20(#139)?= 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 9229f17..e39e9f1 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 = ''