Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
付智勇
2017-09-29 16:55:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b51c0d4d023ca1c94b1a8dfa9377d82556a475cf
b51c0d4d
1 parent
94d0ce6c
no message
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
services/userService.js
services/userService.js
查看文件 @
b51c0d4
...
...
@@ -47,12 +47,13 @@ userService.prototype.login = async(loginName,pw,userEmail) => {
{
loginName
:
loginName
}
];
let
User
=
await
userModel
.
find
({
where
:{
$or
:
queryData
}})
let
attachment
=
await
attachmentModel
.
findOne
({
where
:{
businessId
:
User
.
id
}})
if
(
!
User
){
return
{
code
:
300
,
msg
:
'用户不存在'
}
}
else
if
(
User
.
password
!=
saitMd5
.
md5
(
pw
)){
return
{
code
:
300
,
msg
:
'密码不正确'
}
}
let
attachment
=
await
attachmentModel
.
findOne
({
where
:{
businessId
:
User
.
id
}})
let
token
=
await
tokenUtil
.
getSession
(
User
);
if
(
attachment
){
token
.
userPhoto
=
attachment
.
path
...
...
@@ -173,7 +174,7 @@ userService.prototype.updatePwByTelphone = async(tel,pw) => {
var
t
=
await
sequelize
.
transaction
({
autocommit
:
true
})
let
User
=
await
userModel
.
findOne
({
where
:{
userMobile
:
tel
}})
if
(
!
User
){
t
.
rollback
t
.
rollback
()
return
{
code
:
0
,
msg
:
'用户不存在'
}
}
let
updateUser
=
await
userModel
.
update
({
password
:
pw
.
md5Pass
,
salt
:
pw
.
salt
},{
where
:{
userMobile
:
tel
}});
...
...
请
注册
或
登录
后发表评论