forked from github/dataease
fix: 增加公共链接密码强度
This commit is contained in:
parent
b9a0c31aec
commit
9c967cf1db
@ -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
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ import {
|
||||
shortUrl,
|
||||
setOverTime
|
||||
} from '@/api/link'
|
||||
import { randomRange } from '@/utils/StringUtils'
|
||||
export default {
|
||||
|
||||
name: 'LinkGenerate',
|
||||
@ -171,14 +172,7 @@ export default {
|
||||
},
|
||||
|
||||
createPwd() {
|
||||
const randomNum = () => {
|
||||
return Math.floor(Math.random() * 10) + ''
|
||||
}
|
||||
let result = ''
|
||||
for (let index = 0; index < this.pwdNums; index++) {
|
||||
result += randomNum()
|
||||
}
|
||||
return result
|
||||
return randomRange(this.pwdNums)
|
||||
},
|
||||
|
||||
resetPwd() {
|
||||
|
Loading…
Reference in New Issue
Block a user