add test user

This commit is contained in:
B05BEE13.卢郴群 2020-11-16 13:11:49 +08:00
parent 7f89c32404
commit ef42a5ada7
1 changed files with 2 additions and 2 deletions

View File

@ -1,8 +1,8 @@
// invoked in worker // invoked in worker
think.beforeStartServer(async () => { think.beforeStartServer(async () => {
const username = 'test'; const username = 'test';
let user = await this.model("users").where({ username }).find(); let user = await think.model("users").where({ username }).find();
if (think.isEmpty(user)) { if (think.isEmpty(user)) {
await this.model("users").add({ username, password: 'e10adc3949ba59abbe56e057f20f883e', email: 'ilovejiajia@qq.com' }); await think.model("users").add({ username, password: 'e10adc3949ba59abbe56e057f20f883e', email: 'ilovejiajia@qq.com' });
} }
}) })