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
251ac08d
Commit
251ac08d
authored
Feb 19, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
269405a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
bpo-web/app/base/api/impl/econtractApi.js
+1
-1
bpo-web/app/base/db/models/yzmerchantsigned.js
+2
-0
bpo-web/app/base/service/impl/entcontractSve.js
+30
-5
No files found.
bpo-web/app/base/api/impl/econtractApi.js
View file @
251ac08d
...
...
@@ -790,7 +790,7 @@ class EcontractApi {
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
busi
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
sign
);
console
.
log
(
sign
Str
,
sign
);
if
(
param
.
sign
!=
sign
)
{
return
this
.
returnjson
(
1001001
,
"签名错误"
);
}
...
...
bpo-web/app/base/db/models/yzmerchantsigned.js
View file @
251ac08d
...
...
@@ -8,6 +8,8 @@ module.exports = (db, DataTypes) => {
mchtId
:
DataTypes
.
STRING
,
mainId
:
DataTypes
.
STRING
,
secret
:
DataTypes
.
STRING
,
ecid
:
DataTypes
.
INTEGER
,
entcontract_id
:
DataTypes
.
INTEGER
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
bpo-web/app/base/service/impl/entcontractSve.js
View file @
251ac08d
...
...
@@ -261,12 +261,13 @@ class EntcontractService extends ServiceBase {
companyName
:
params
.
merchantName
,
});
if
(
!
erchants
)
{
this
.
yzmerchantsignedDao
.
create
({
erchants
=
await
this
.
yzmerchantsignedDao
.
create
({
companyName
:
params
.
merchantName
,
appId
:
reso
.
data
.
appId
,
mchtId
:
reso
.
data
.
mchtId
,
mainId
:
reso
.
data
.
mainId
,
secret
:
reso
.
data
.
secret
,
entcontract_id
:
params
.
entcontract_id
,
});
}
...
...
@@ -304,8 +305,12 @@ class EntcontractService extends ServiceBase {
isEnabled
:
true
,
});
}
reso
.
data
.
ecid
=
template
.
id
;
if
(
!
erchants
.
ecid
)
{
erchants
.
ecid
=
template
.
id
;
await
erchants
.
save
();
}
let
busi
=
await
this
.
ecompanybusiDao
.
findOne
({
ecompany_id
:
ecompany
.
id
,
...
...
@@ -329,8 +334,6 @@ class EntcontractService extends ServiceBase {
busi
.
key
=
reso
.
data
.
secret
;
await
busi
.
save
();
}
return
reso
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
...
...
@@ -526,7 +529,28 @@ class EntcontractService extends ServiceBase {
});
if
(
entcontract
)
{
return
this
.
returnjson
(
0
,
"该商户已签约"
);
// return this.returnjson(0, "该商户已签约");
let
merchantSign
=
await
this
.
yzmerchantsignedDao
.
findOne
({
entcontract_id
:
entcontract
.
id
,
});
if
(
!
merchantSign
)
{
return
this
.
returnjson
(
500
,
"数据错误"
);
}
let
res
=
{
code
:
0
,
msg
:
"执行成功"
,
data
:
{
ecid
:
merchantSign
.
ecid
,
appId
:
merchantSign
.
appId
,
mchtId
:
merchantSign
.
mchtId
,
mainId
:
merchantSign
.
mainId
,
secret
:
merchantSign
.
secret
,
},
}
return
res
;
}
// e签宝流程
...
...
@@ -635,6 +659,7 @@ class EntcontractService extends ServiceBase {
entcontract
.
end_at
=
end_at
;
await
entcontract
.
save
();
params
.
entcontract_id
=
entcontract
.
id
;
// this.syncSign(entcontract.id);
return
await
this
.
createYzMerchant
(
params
);
// return this.returnjson(0, "success", {
...
...
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