This commit is contained in:
Archer
2023-11-15 11:36:25 +08:00
committed by GitHub
parent 592e1a93a2
commit bfd8be5df0
181 changed files with 2499 additions and 1552 deletions

View File

@@ -40,20 +40,18 @@ async function initRootUser() {
await MongoUser.findOneAndUpdate(
{ username: 'root' },
{
password: hashStr(psw),
balance: 999999 * PRICE_SCALE
password: hashStr(psw)
}
);
} else {
const { _id } = await MongoUser.create({
username: 'root',
password: hashStr(psw),
balance: 999999 * PRICE_SCALE
password: hashStr(psw)
});
rootId = _id;
}
// init root team
await createDefaultTeam({ userId: rootId, maxSize: 1 });
await createDefaultTeam({ userId: rootId, maxSize: 1, balance: 9999 * PRICE_SCALE });
console.log(`root user init:`, {
username: 'root',