16 lines
479 B
JavaScript
16 lines
479 B
JavaScript
/**
|
|
* app.components.login.accountPassword
|
|
* 账号密码登陆
|
|
* @param {string} data.account 账号.
|
|
* @param {string} data.password 密码.
|
|
* @return {object} res 验证是否通过.
|
|
*/
|
|
module.exports = async (data) => {
|
|
const {account, password} = data
|
|
const User = await app.db.table("User").where({account}).find()
|
|
if (!User) return false
|
|
const {salt} = User
|
|
const ver = app.components.encrypt.cryptPwdVerification(password, salt, User.password)
|
|
return ver
|
|
}
|