修改关卡记录逻辑
This commit is contained in:
10
game-server/app/util/util.ts
Normal file
10
game-server/app/util/util.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
export function genCode(len) {
|
||||
const chars = '123456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
const charArr = chars.split('');
|
||||
let code = '';
|
||||
for (let i = 0; i < len; i++) {
|
||||
code += charArr[Math.floor(Math.random() * charArr.length)];
|
||||
}
|
||||
return code;
|
||||
}
|
||||
Reference in New Issue
Block a user