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
7bf9b2bc
Commit
7bf9b2bc
authored
Apr 12, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
10293756
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
center-app/app/base/api/api.base.js
+1
-1
center-app/app/base/api/impl/payment/aliPayment.js
+4
-0
center-app/app/base/db/metadata/apps/platform.js
+6
-3
center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js
+11
-11
No files found.
center-app/app/base/api/api.base.js
View file @
7bf9b2bc
...
@@ -53,7 +53,7 @@ class APIBase {
...
@@ -53,7 +53,7 @@ class APIBase {
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
req
.
requestId
=
this
.
getUUID
();
try
{
try
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"getPayInfo"
,
"test"
].
indexOf
(
methodname
)
<
0
)
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"getPayInfo"
,
"
verifyAliPayReturnSign"
,
"
test"
].
indexOf
(
methodname
)
<
0
)
{
if
(
!
pobj
.
appInfo
)
{
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
}
}
...
...
center-app/app/base/api/impl/payment/aliPayment.js
View file @
7bf9b2bc
...
@@ -14,6 +14,10 @@ class AliPayment extends APIBase {
...
@@ -14,6 +14,10 @@ class AliPayment extends APIBase {
var
result
=
await
this
.
utilsAlibankSve
.
getH5AliDingPayInfo
(
pobj
,
pobj
.
actionBody
);
var
result
=
await
this
.
utilsAlibankSve
.
getH5AliDingPayInfo
(
pobj
,
pobj
.
actionBody
);
return
result
;
return
result
;
}
}
async
verifyAliPayReturnSign
(
pobj
,
query
,
req
)
{
var
result
=
await
this
.
utilsAlibankSve
.
verifyAliPayReturnSign
(
pobj
,
pobj
);
return
result
;
}
async
test
(
pobj
,
qobj
,
req
)
{
async
test
(
pobj
,
qobj
,
req
)
{
// var pobj = { appInfo: { uapp_id: 22 }, actionBody: { total_fee: 0.01, order_num: "111222", body_desc: "标题描述1" } };
// var pobj = { appInfo: { uapp_id: 22 }, actionBody: { total_fee: 0.01, order_num: "111222", body_desc: "标题描述1" } };
var
actionBody
=
{
var
actionBody
=
{
...
...
center-app/app/base/db/metadata/apps/platform.js
View file @
7bf9b2bc
...
@@ -29,10 +29,13 @@ module.exports = {
...
@@ -29,10 +29,13 @@ module.exports = {
//接口类型
//接口类型
"interface_type"
:
{
"bd"
:
"本地"
,
"yc"
:
"远程"
},
"interface_type"
:
{
"bd"
:
"本地"
,
"yc"
:
"远程"
},
//操作类型
//操作类型
"op_type"
:
{
"addOrder"
:
"添加订单"
,
"pushOrder"
:
"推送订单"
,
"pushUpdateOrder"
:
"推送修改订单"
,
"pushUpdateOrderContacts"
:
"推送修改订单联系人"
,
"op_type"
:
{
"pushOrderBusiness"
:
"推送订单商机"
,
"pushOrderRefund"
:
"推送订单退款"
,
"pushNeedBusiness"
:
"推送需求商机"
,
"pushNeedNote"
:
"推送需求小计"
,
"addOrder"
:
"添加订单"
,
"pushOrder"
:
"推送订单"
,
"pushUpdateOrder"
:
"推送修改订单"
,
"pushUpdateOrderContacts"
:
"推送修改订单联系人"
,
"pushOrderBusiness"
:
"推送订单商机"
,
"pushOrderRefund"
:
"推送订单退款"
,
"pushNeedBusiness"
:
"推送需求商机"
,
"pushNeedNote"
:
"推送需求小计"
,
"pushCloseNeed"
:
"推送关闭需求"
,
"pushNeedSolution"
:
"推送需求方案"
,
"pushCloseNeedSolution"
:
"推送关闭需求方案"
,
"pushOpSolution"
:
"推送操作方案"
,
"pushCloseNeed"
:
"推送关闭需求"
,
"pushNeedSolution"
:
"推送需求方案"
,
"pushCloseNeedSolution"
:
"推送关闭需求方案"
,
"pushOpSolution"
:
"推送操作方案"
,
"createAliTmApply"
:
"创建阿里商标申请"
,
"closeAliTmApply"
:
"主动关闭阿里商标申请"
},
"createAliTmApply"
:
"推送创建阿里商标申请"
,
"closeAliTmApply"
:
"推送主动关闭阿里商标申请"
,
"bindAliTmApplicantGzwts"
:
"推送绑定阿里商标申请人盖章委托书"
,
"updateAliTmApplicant"
:
"推送更新阿里商标申请人信息"
},
//---------
//---------
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
...
...
center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js
View file @
7bf9b2bc
...
@@ -89,7 +89,7 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -89,7 +89,7 @@ class utilsTlBankSve extends AppServiceBase {
return
prestr
;
return
prestr
;
}
}
async
verifyAliPayReturnSign
(
pobj
,
actionBody
)
{
async
verifyAliPayReturnSign
(
actionBody
)
{
if
(
!
actionBody
.
out_trade_no
)
{
if
(
!
actionBody
.
out_trade_no
)
{
return
{
status
:
-
305
,
msg
:
"out_trade_no param can not be empty"
};
return
{
status
:
-
305
,
msg
:
"out_trade_no param can not be empty"
};
}
}
...
@@ -97,7 +97,7 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -97,7 +97,7 @@ class utilsTlBankSve extends AppServiceBase {
if
(
outTradeInfo
.
length
<
2
)
{
if
(
outTradeInfo
.
length
<
2
)
{
return
{
status
:
-
307
,
msg
:
"out_trade_no into is error"
};
return
{
status
:
-
307
,
msg
:
"out_trade_no into is error"
};
}
}
pobj
.
appInfo
=
{
uapp_id
:
outTradeInfo
[
1
]
};
var
pobj
=
{
appInfo
:
{
uapp_id
:
outTradeInfo
[
1
]
}
};
var
getSignStrResult
=
await
this
.
getSortSignStr
(
actionBody
);
var
getSignStrResult
=
await
this
.
getSortSignStr
(
actionBody
);
if
(
getSignStrResult
.
status
!=
0
)
{
if
(
getSignStrResult
.
status
!=
0
)
{
return
getSignStrResult
;
return
getSignStrResult
;
...
@@ -110,8 +110,8 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -110,8 +110,8 @@ class utilsTlBankSve extends AppServiceBase {
if
(
verifyResult
)
{
if
(
verifyResult
)
{
return
system
.
getResultSuccess
({
return
system
.
getResultSuccess
({
orderNo
:
outTradeInfo
[
0
],
orderNo
:
outTradeInfo
[
0
],
uappId
:
outTradeInfo
[
1
]
,
uappId
:
Number
(
outTradeInfo
[
1
])
,
productId
:
outTradeInfo
.
length
==
3
?
outTradeInfo
[
2
]
:
0
productId
:
outTradeInfo
.
length
==
3
?
Number
(
outTradeInfo
[
2
])
:
0
});
});
}
}
return
system
.
getResult
(
null
,
"验签失败,verifyPayReturnSign"
);
return
system
.
getResult
(
null
,
"验签失败,verifyPayReturnSign"
);
...
@@ -124,13 +124,13 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -124,13 +124,13 @@ class utilsTlBankSve extends AppServiceBase {
key
.
importKey
(
publicKey
,
'pkcs8-public-pem'
);
//导入密钥并设定格式
key
.
importKey
(
publicKey
,
'pkcs8-public-pem'
);
//导入密钥并设定格式
// const publicDer = key.exportKey('pkcs8-private');
// const publicDer = key.exportKey('pkcs8-private');
let
signature
=
key
.
verify
(
Buffer
.
from
(
signParamStr
),
verifySignStr
,
sourceEncoding
,
signatureEncoding
);
let
signature
=
key
.
verify
(
Buffer
.
from
(
signParamStr
),
verifySignStr
,
sourceEncoding
,
signatureEncoding
);
//
this.logCtl.info({
this
.
logCtl
.
info
({
//
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
:
""
,
//
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
:
""
,
// op: "center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js/getCreateAli
SignStr",
op
:
"center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js/getVerifyPay
SignStr"
,
// content: "参数:" + paramStr + "返回
结果signStr:" + signature,
content
:
"参数:"
+
signParamStr
+
"验证签名
结果signStr:"
+
signature
,
// optitle: "获取钉钉支付签名信息返回
",
optitle
:
"获取钉钉支付返回签名验证
"
,
//
});
});
return
signature
;
return
signature
;
}
}
...
...
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