初始化

This commit is contained in:
robin
2022-08-02 19:21:03 +08:00
parent 73c1343060
commit b7e5ee5fec
27 changed files with 564 additions and 156 deletions
@@ -7,9 +7,9 @@
* @return {boolean} 注册 是否 成功.
*/
module.exports = async (data) => {
const {account, password} = data
const {account, password, oid} = data
const salt = app.components.encrypt.getRandomSalt()
const md5 = app.components.encrypt.cryptPwd(password, salt)
await app.db.table("User").data({account, password: md5, salt}).save()
await app.db.table("User").data({account, password: md5, salt, to_oid: oid}).save()
return true
}