You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const md5 = require('md5');
|
|
|
|
const {
|
|
|
|
loginDao
|
|
|
|
} = require("../dao/userDao")
|
|
|
|
module.exports.loginService = async function (loginInfo) {
|
|
|
|
//将明文密码转换为加密密码
|
|
|
|
loginInfo.loginPwd = md5(loginInfo.loginPwd);
|
|
|
|
let userInfo = await loginDao(loginInfo)
|
|
|
|
if (userInfo) {
|
|
|
|
userInfo = {
|
|
|
|
id: userInfo.id,
|
|
|
|
loginId: userInfo.loginId
|
|
|
|
}
|
|
|
|
console.log(userInfo)
|
|
|
|
|
|
|
|
//添加token后返回
|
|
|
|
let token = ""
|
|
|
|
token = "123"
|
|
|
|
return {
|
|
|
|
token,
|
|
|
|
data: userInfo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
data: userInfo
|
|
|
|
}
|
|
|
|
}
|