add test user
This commit is contained in:
parent
7f89c32404
commit
ef42a5ada7
|
|
@ -1,8 +1,8 @@
|
|||
// invoked in worker
|
||||
think.beforeStartServer(async () => {
|
||||
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)) {
|
||||
await this.model("users").add({ username, password: 'e10adc3949ba59abbe56e057f20f883e', email: 'ilovejiajia@qq.com' });
|
||||
await think.model("users").add({ username, password: 'e10adc3949ba59abbe56e057f20f883e', email: 'ilovejiajia@qq.com' });
|
||||
}
|
||||
})
|
||||
Loading…
Reference in New Issue