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
4bbc200d
Commit
4bbc200d
authored
Apr 08, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gbs
parent
bd9b4d82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
75 deletions
+129
-75
xgg-admin/app/base/api/api.base.js
+30
-27
xgg-admin/app/base/api/impl/module/orderApi.js
+51
-0
xgg-admin/app/base/api/impl/op/action.js
+48
-48
No files found.
xgg-admin/app/base/api/api.base.js
View file @
4bbc200d
...
...
@@ -64,7 +64,8 @@ class APIBase extends DocBase {
"test.testInvoice"
,
];
var
x
=
lst
.
indexOf
(
fullname
);
return
x
>=
0
;
// return x >= 0;
return
true
;
}
async
checkAcck
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
var
appInfo
=
null
;
...
...
@@ -72,33 +73,35 @@ class APIBase extends DocBase {
var
ispass
=
await
this
.
isCheckWhiteList
(
gname
,
methodname
);
var
appkey
=
req
.
headers
[
"accesskey"
];
var
app_id
=
req
.
headers
[
"app_id"
];
if
(
ispass
)
{
return
result
;
}
//在白名单里面
if
(
app_id
)
{
appInfo
=
await
this
.
cacheManager
[
"ApiAppIdCheckCache"
].
cache
(
app_id
,
null
,
3000
);
if
(
!
appInfo
)
{
result
.
status
=
system
.
appidFail
;
result
.
msg
=
"请求头app_id值失效,请重新获取"
;
}
return
result
;
var
signResult
=
await
this
.
verifySign
(
pobj
.
action_body
,
appInfo
.
appSecret
);
if
(
signResult
.
status
!=
0
)
{
result
.
status
=
system
.
signFail
;
result
.
msg
=
signResult
.
msg
;
}
}
//验签
else
if
(
appkey
)
{
appInfo
=
await
this
.
cacheManager
[
"ApiAccessKeyCheckCache"
].
cache
(
appkey
,
{
status
:
true
},
3000
);
if
(
!
appInfo
||
!
appInfo
.
app
)
{
result
.
status
=
system
.
tokenFail
;
result
.
msg
=
"请求头accesskey失效,请重新获取"
;
}
}
//验证accesskey
else
{
result
.
status
=
-
1
;
result
.
msg
=
"请求头没有相关访问参数,请验证后在进行请求"
;
}
// if (ispass) {
// return result;
// }//在白名单里面
// if (app_id) {
// appInfo = await this.cacheManager["ApiAppIdCheckCache"].cache(app_id, null, 3000);
// if (!appInfo) {
// result.status = system.appidFail;
// result.msg = "请求头app_id值失效,请重新获取";
// }
//
// var signResult = await this.verifySign(pobj.action_body, appInfo.appSecret);
// if (signResult.status != 0) {
// result.status = system.signFail;
// result.msg = signResult.msg;
// }
// }//验签
// else if (appkey) {
// appInfo = await this.cacheManager["ApiAccessKeyCheckCache"].cache(appkey, { status: true }, 3000);
// if (!appInfo || !appInfo.app) {
// result.status = system.tokenFail;
// result.msg = "请求头accesskey失效,请重新获取";
// }
// }//验证accesskey
// else {
// result.status = -1;
// result.msg = "请求头没有相关访问参数,请验证后在进行请求";
// }
return
result
;
}
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
...
...
xgg-admin/app/base/api/impl/module/orderApi.js
0 → 100644
View file @
4bbc200d
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
OrderAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
async
test
(
pobj
,
query
,
req
)
{
// var tmp = await this.orderSve.createLicense(pobj.action_body);
// 获取验证码
// await this.platformUtils.fetchVCode(pobj.action_body.mobile);
// 创建用户
// var result = await this.platformUtils.createUserInfo("13075556691", "13075556693", "9366");
// 创建用户
return
pobj
;
}
exam
()
{
return
""
;
}
classDesc
()
{
return
{
groupName
:
""
,
groupDesc
:
""
,
name
:
""
,
desc
:
""
,
exam
:
""
,
};
}
methodDescs
()
{
return
[
{
methodDesc
:
""
,
methodName
:
""
,
paramdescs
:
[
{
paramDesc
:
""
,
paramName
:
""
,
paramType
:
""
,
defaultValue
:
""
,
}
],
rtnTypeDesc
:
""
,
rtnType
:
""
}
];
}
}
module
.
exports
=
OrderAPI
;
\ No newline at end of file
xgg-admin/app/base/api/impl/op/action.js
View file @
4bbc200d
...
...
@@ -46,54 +46,54 @@ class ActionAPI extends APIBase {
var
opResult
=
null
;
switch
(
action_type
)
{
// sy
case
"queryMerchant"
:
//查询商户
opResult
=
await
this
.
merchantSve
.
apiQueryMerchant
(
action_body
);
break
;
case
"addOrder"
:
//添加订单
opResult
=
await
this
.
orderSve
.
addOrder
(
action_body
);
break
;
case
"putOrder"
:
//修改订单
opResult
=
await
this
.
orderSve
.
putOrder
(
action_body
);
break
;
case
"queryOrder"
:
//订单查询
opResult
=
await
this
.
orderSve
.
queryOrder
(
action_body
);
break
;
case
"orderClose"
:
//订单查询
opResult
=
await
this
.
orderSve
.
orderClose
(
action_body
);
break
;
case
"putContract"
:
//个体工商户合同接收接口
opResult
=
await
this
.
businessmenSve
.
putContract
(
action_body
);
break
;
case
"queryBusinessmen"
:
//个体工商户信息查询接口
opResult
=
await
this
.
businessmenSve
.
queryBusinessmen
(
action_body
);
break
;
case
"rechargeApplication"
:
// 商户充值申请
opResult
=
await
this
.
merchantrechargeSve
.
add
(
action_body
);
break
;
case
"queryMerchantAccount"
:
// 商户充值申请
opResult
=
await
this
.
merchantaccountSve
.
infoByMerchantId
(
action_body
);
break
;
case
"calcInvoice"
:
// 发票试算接口
opResult
=
await
this
.
invoiceSve
.
apiCalcInvoice
(
action_body
);
break
;
case
"saveInvoice"
:
// 发票提交接口
opResult
=
await
this
.
invoiceSve
.
apiSaveInvoice
(
action_body
);
break
;
case
"cancelInvoice"
:
// 发票提交接口
opResult
=
await
this
.
invoiceSve
.
apiCancelInvoice
(
action_body
);
break
;
case
"queryInvoice"
:
// 发票提交接口
opResult
=
await
this
.
invoiceSve
.
apiQueryInvoice
(
action_body
);
break
;
case
"queryTaxInvoice"
:
opResult
=
await
this
.
invoiceSve
.
apiQueryTaxInvoice
(
action_body
);
break
;
case
"queryCourierTrace"
:
opResult
=
await
this
.
courierSve
.
queryCourierTrace
(
action_body
);
break
;
//
case "queryMerchant"://查询商户
//
opResult = await this.merchantSve.apiQueryMerchant(action_body);
//
break;
//
case "addOrder"://添加订单
//
opResult = await this.orderSve.addOrder(action_body);
//
break;
//
case "putOrder"://修改订单
//
opResult = await this.orderSve.putOrder(action_body);
//
break;
//
case "queryOrder"://订单查询
//
opResult = await this.orderSve.queryOrder(action_body);
//
break;
//
case "orderClose"://订单查询
//
opResult = await this.orderSve.orderClose(action_body);
//
break;
//
//
case "putContract"://个体工商户合同接收接口
//
opResult = await this.businessmenSve.putContract(action_body);
//
break;
//
case "queryBusinessmen"://个体工商户信息查询接口
//
opResult = await this.businessmenSve.queryBusinessmen(action_body);
//
break;
//
//
case "rechargeApplication":// 商户充值申请
//
opResult = await this.merchantrechargeSve.add(action_body);
//
break;
//
case "queryMerchantAccount":// 商户充值申请
//
opResult = await this.merchantaccountSve.infoByMerchantId(action_body);
//
break;
//
case "calcInvoice": // 发票试算接口
//
opResult = await this.invoiceSve.apiCalcInvoice(action_body);
//
break;
//
case "saveInvoice": // 发票提交接口
//
opResult = await this.invoiceSve.apiSaveInvoice(action_body);
//
break;
//
case "cancelInvoice": // 发票提交接口
//
opResult = await this.invoiceSve.apiCancelInvoice(action_body);
//
break;
//
case "queryInvoice": // 发票提交接口
//
opResult = await this.invoiceSve.apiQueryInvoice(action_body);
//
break;
// case "queryTaxInvoice":
//
opResult = await this.invoiceSve.apiQueryTaxInvoice(action_body);
//
break;
//
// case "queryCourierTrace":
//
opResult = await this.courierSve.queryCourierTrace(action_body);
//
break;
// // 以下接口为推送测试
// case "testRechargeAudit":// 发票信息查询接口
// opResult = await this.merchantrechargeSve.apiAudit(action_body);
...
...
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