Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
997a028e
Commit
997a028e
authored
Feb 18, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
22bc56ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
laowubao/app/base/api/impl/operator/laoActionApi.js
+20
-18
laowubao/app/base/db/models/operator/users.js
+1
-0
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
997a028e
...
...
@@ -104,40 +104,42 @@ class LaoActionApi extends APIBase {
data
=
this
.
decryption
(
data
);
try
{
data
=
JSON
.
parse
(
data
);
if
(
!
data
.
mobil
e
)
{
return
system
.
getResult
(
-
1
,
`
手机号码错误
${
data
.
mobile
}
`
);
if
(
!
data
.
userNam
e
)
{
return
system
.
getResult
(
-
1
,
`
登录名称为空
`
);
}
if
(
!
data
.
companyName
)
{
return
system
.
getResult
(
-
1
,
`
企业名称错误
${
data
.
companyName
}
`
);
return
system
.
getResult
(
-
1
,
`
商户名称为空
`
);
}
var
parm
=
{
phone_no
:
data
.
mobile
if
(
!
data
.
mtchId
)
{
return
system
.
getResult
(
-
1
,
`商户号为空`
);
}
var
result
=
await
this
.
usersSve
.
findUserInfoByPhone
(
parm
);
if
(
result
.
status
==
-
1
)
{
parm
=
{
phone_no
:
data
.
mobile
,
var
loginUser
=
await
this
.
usersSve
.
findOne
({
mtchId
:
data
.
mtchId
});
if
(
loginUser
)
{
loginUser
.
com_name
=
data
.
companyName
;
loginUser
.
mtchId
=
data
.
mtchId
;
await
loginUser
.
save
();
}
else
{
loginUser
=
await
this
.
usersSve
.
create
({
phone_no
:
data
.
userName
,
user_type
:
"招人方"
,
status_type
:
1
,
status_name
:
"正常"
,
reg_time
:
(
new
Date
()).
Format
(
"yyyy-MM-dd"
),
com_type
:
2
,
com_name
:
data
.
companyName
,
};
result
=
await
this
.
usersSve
.
SaveUserInfo
(
parm
);
mtchId
:
data
.
mtchId
,
}
);
}
var
user_id
=
result
.
data
.
id
;
//var user_id = 1;
parm
=
{
user_id
:
user_
id
,
await
this
.
logSve
.
SaveLogInfo
(
{
user_id
:
loginUser
.
id
,
oper_type
:
0
,
oper_name
:
"发薪系统自动登录"
,
oper_date
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
};
await
this
.
logSve
.
SaveLogInfo
(
parm
);
return
result
;
});
return
system
.
getResultSuccess
(
loginUser
);
}
catch
(
error
)
{
console
.
log
(
e
);
console
.
log
(
e
rror
);
return
system
.
getResult
(
-
1
,
`a
${
data
}
解析错误`
);
}
}
...
...
laowubao/app/base/db/models/operator/users.js
View file @
997a028e
...
...
@@ -23,6 +23,7 @@ module.exports = (db, DataTypes) => {
card_path
:
DataTypes
.
STRING
(
2000
),
cert_path
:
DataTypes
.
STRING
(
2000
),
reg_time
:
DataTypes
.
DATE
,
mtchId
:
DataTypes
.
STRING
,
cattes_time
:
DataTypes
.
DATE
,
uattes_time
:
DataTypes
.
DATE
,
memo1_text
:
DataTypes
.
STRING
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment