1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

repair generator password bug

This commit is contained in:
shanshuirenjia
2019-05-06 16:08:34 +08:00
parent 80d75e2d74
commit deb68ee365
5 changed files with 29 additions and 8 deletions

View File

@@ -813,4 +813,13 @@ export const Utils = {
}
},
generatePassword: function(passwordLength) {
let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789';
let password = '';
for (let i = 0; i < passwordLength; i++) {
password += possible.charAt(Math.floor(Math.random() * possible.length));
}
return password;
}
};