feat: 系统升级支持数据库自动迁移,避免手动执行升级脚本

This commit is contained in:
meilin.huang
2025-02-13 21:11:23 +08:00
parent efb2b7368c
commit aa393590b2
78 changed files with 1965 additions and 1827 deletions

View File

@@ -203,6 +203,15 @@ export function randomPassword(length = 10) {
return password.join('');
}
export function randomString(length = 8) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += getRandomChar(chars);
}
return result;
}
function getRandomChar(charSet: string) {
const randomIndex = Math.floor(Math.random() * charSet.length);
return charSet[randomIndex];