fix: fix Bug 531 and use ES6 grammar
parent
688ed72473
commit
f64d06fbbf
|
@ -68,9 +68,9 @@
|
||||||
<script>
|
<script>
|
||||||
// 密码生成器
|
// 密码生成器
|
||||||
function generatePassword(length) {
|
function generatePassword(length) {
|
||||||
var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+~`|}{[]\:;?><,./-=";
|
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^*()_+~`|}{[]\:;?,./-=";
|
||||||
var password = "";
|
let password = "";
|
||||||
for (var i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
password += charset.charAt(Math.floor(Math.random() * charset.length));
|
password += charset.charAt(Math.floor(Math.random() * charset.length));
|
||||||
}
|
}
|
||||||
return password;
|
return password;
|
||||||
|
|
Loading…
Reference in New Issue