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