Skip to content

Commit

Permalink
fix: 修复DSL出码报错 (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyun8 authored Dec 11, 2023
1 parent fd5baf1 commit af3989a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue-generator/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down

0 comments on commit af3989a

Please sign in to comment.