fix: 增加公共链接密码强度

This commit is contained in:
fit2cloud-chenyw
2022-03-23 15:01:40 +08:00
parent b9a0c31aec
commit 9c967cf1db
2 changed files with 13 additions and 8 deletions

View File

@@ -5,3 +5,14 @@ export function pdfTemplateReplaceAll(content, source, target) {
return content
}
export function randomRange(min, max) {
let returnStr = ''
const range = (max ? Math.round(Math.random() * (max - min)) + min : min)
const charStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
for (var i = 0; i < range; i++) {
var index = Math.round(Math.random() * (charStr.length - 1))
returnStr += charStr.substring(index, index + 1)
}
return returnStr
}