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
846ee4e8
Commit
846ee4e8
authored
May 19, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新接口
parent
ab84846f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
986 additions
and
1011 deletions
+986
-1011
center-channel/app/base/api/api.base.js
+0
-1
center-channel/app/base/api/impl/icp/consultation.js
+29
-267
center-channel/app/base/api/impl/icp/order.js
+46
-178
center-channel/app/base/db/metadata/apps/platform.js
+5
-6
center-channel/app/base/db/models/common/gatewaypushlog.js
+53
-53
center-channel/app/base/service/impl/receiveSve/icpNeedSve.js
+97
-0
center-channel/app/base/service/impl/receiveSve/icpOrderSve.js
+186
-0
center-channel/app/base/system.js
+7
-0
center-channel/app/config/routes/api.js
+40
-59
center-channel/app/config/settings.js
+523
-447
No files found.
center-channel/app/base/api/api.base.js
View file @
846ee4e8
...
...
@@ -24,7 +24,6 @@ class APIBase {
//-----------------------新的模式------------------开始
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
try
{
var
shaStr
=
await
sha256
(
JSON
.
stringify
(
pobj
));
...
...
center-channel/app/base/api/impl/icp/consultation.js
View file @
846ee4e8
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
let
APIBase
=
require
(
"../../api.base"
);
let
system
=
require
(
"../../../system"
);
let
settings
=
require
(
"../../../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
/**
* icp通知接口(百度icp接入)
* 庄冰 2020.10.22
* 增值服务需求服务
*/
class
Consultation
extends
APIBase
{
constructor
()
{
...
...
@@ -12,287 +12,48 @@ class Consultation extends APIBase {
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
getResultSuccess
(
requestId
)
{
return
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
requestId
};
}
getResultFail
(
errmsg
)
{
var
self
=
this
;
return
{
"status"
:
-
1
,
"msg"
:
errmsg
,
"requestId"
:
self
.
getUUID
(),
"data"
:
null
,
"bizmsg"
:
"empty"
};
}
//icp需求提交
async
submit
(
pobj
,
obj
,
req
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
async
submit
(
pobj
,
obj
,
req
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
system
.
getResultFailByErrMsg
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
intentionBizId
)
{
return
s
elf
.
getResultFail
(
"intentionBizId不能为空"
);
return
s
ystem
.
getResultFailByErrMsg
(
"intentionBizId不能为空"
);
}
if
(
!
pobj
.
phone
)
{
return
s
elf
.
getResultFail
(
"mobile不能为空"
);
return
s
ystem
.
getResultFailByErrMsg
(
"mobile不能为空"
);
}
if
(
!
pobj
.
consultType
)
{
return
s
elf
.
getResultFail
(
"consultType不能为空"
);
return
s
ystem
.
getResultFailByErrMsg
(
"consultType不能为空"
);
}
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
}
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
}
pobj
.
area
=
settings
.
areaConfig
[
pobj
.
area
];
pobj
.
type
=
pobj
.
consultType
;
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
action_type
=
"submitIcpNeed"
;
if
(
pobj
.
area
)
{
switch
(
pobj
.
area
)
{
case
"1"
:
pobj
.
area
=
"北京"
;
break
;
case
"2"
:
pobj
.
area
=
"上海"
;
break
;
case
"3"
:
pobj
.
area
=
"福建"
;
break
;
case
"4"
:
pobj
.
area
=
"广西"
;
break
;
case
"5"
:
pobj
.
area
=
"广东"
;
break
;
case
"6"
:
pobj
.
area
=
"安徽"
;
break
;
case
"7"
:
pobj
.
area
=
"河南"
;
break
;
case
"8"
:
pobj
.
area
=
"湖北"
;
break
;
case
"9"
:
pobj
.
area
=
"浙江"
;
break
;
case
"10"
:
pobj
.
area
=
"江苏"
;
break
;
case
"11"
:
pobj
.
area
=
"山东"
;
break
;
case
"12"
:
pobj
.
area
=
"陕西"
;
break
;
case
"13"
:
pobj
.
area
=
"宁夏"
;
break
;
case
"14"
:
pobj
.
area
=
"甘肃"
;
break
;
case
"15"
:
pobj
.
area
=
"新疆"
;
break
;
case
"16"
:
pobj
.
area
=
"青海"
;
break
;
case
"17"
:
pobj
.
area
=
"天津"
;
break
;
case
"18"
:
pobj
.
area
=
"重庆"
;
break
;
case
"19"
:
pobj
.
area
=
"河北"
;
break
;
case
"20"
:
pobj
.
area
=
"山西"
;
break
;
case
"21"
:
pobj
.
area
=
"辽宁"
;
break
;
case
"22"
:
pobj
.
area
=
"吉林"
;
break
;
case
"23"
:
pobj
.
area
=
"黑龙江"
;
break
;
case
"24"
:
pobj
.
area
=
"江西"
;
break
;
case
"25"
:
pobj
.
area
=
"湖南"
;
break
;
case
"26"
:
pobj
.
area
=
"四川"
;
break
;
case
"27"
:
pobj
.
area
=
"贵州"
;
break
;
case
"28"
:
pobj
.
area
=
"云南"
;
break
;
case
"29"
:
pobj
.
area
=
"内蒙古"
;
break
;
case
"30"
:
pobj
.
area
=
"西藏"
;
break
;
case
"31"
:
pobj
.
area
=
"含外资"
;
break
;
case
"32"
:
pobj
.
area
=
"全外资"
;
break
;
case
"33"
:
pobj
.
area
=
"香港"
;
break
;
case
"34"
:
pobj
.
area
=
"海南"
;
break
;
case
"BEIJING"
:
pobj
.
area
=
"北京"
;
break
;
case
"SHANGHAI"
:
pobj
.
area
=
"上海"
;
break
;
case
"FUJIAN"
:
pobj
.
area
=
"福建"
;
break
;
case
"GUANGXI"
:
pobj
.
area
=
"广西"
;
break
;
case
"GUANGDONG"
:
pobj
.
area
=
"广东"
;
break
;
case
"ANHUI"
:
pobj
.
area
=
"安徽"
;
break
;
case
"HENAN"
:
pobj
.
area
=
"河南"
;
break
;
case
"HUBEI"
:
pobj
.
area
=
"湖北"
;
break
;
case
"ZHEJIANG"
:
pobj
.
area
=
"浙江"
;
break
;
case
"JIANGSU"
:
pobj
.
area
=
"江苏"
;
break
;
case
"SHANDONG"
:
pobj
.
area
=
"山东"
;
break
;
case
"SHANGXI_SHAN"
:
pobj
.
area
=
"陕西"
;
break
;
case
"NINGXIA"
:
pobj
.
area
=
"宁夏"
;
break
;
case
"GANSU"
:
pobj
.
area
=
"甘肃"
;
break
;
case
"XINJIANG"
:
pobj
.
area
=
"新疆"
;
break
;
case
"QINGHAI"
:
pobj
.
area
=
"青海"
;
break
;
case
"TIANJIN"
:
pobj
.
area
=
"天津"
;
break
;
case
"CHONGQING"
:
pobj
.
area
=
"重庆"
;
break
;
case
"HEBEI"
:
pobj
.
area
=
"河北"
;
break
;
case
"SHANXI_JIN"
:
pobj
.
area
=
"山西"
;
break
;
case
"LIAONING"
:
pobj
.
area
=
"辽宁"
;
break
;
case
"JINLIN"
:
pobj
.
area
=
"吉林"
;
break
;
case
"HEILONGJIANG"
:
pobj
.
area
=
"黑龙江"
;
break
;
case
"JIANGXI"
:
pobj
.
area
=
"江西"
;
break
;
case
"HUNAN"
:
pobj
.
area
=
"湖南"
;
break
;
case
"SICHUAN"
:
pobj
.
area
=
"四川"
;
break
;
case
"GUIZHOU"
:
pobj
.
area
=
"贵州"
;
break
;
case
"YUNNAN"
:
pobj
.
area
=
"云南"
;
break
;
case
"NEIMENGGU"
:
pobj
.
area
=
"内蒙古"
;
break
;
case
"XIZANG"
:
pobj
.
area
=
"西藏"
;
break
;
case
"HANWAIZI"
:
pobj
.
area
=
"含外资"
;
break
;
case
"QUANWAIZI"
:
pobj
.
area
=
"全外资"
;
break
;
case
"XIANGGANG"
:
pobj
.
area
=
"香港"
;
break
;
case
"HAINAN"
:
pobj
.
area
=
"海南"
;
break
;
case
"GUANGZHOU"
:
pobj
.
area
=
"广州"
;
break
;
case
"SHENZHEN"
:
pobj
.
area
=
"深圳"
;
break
;
case
"QUANGUO"
:
pobj
.
area
=
"全国"
;
break
;
default
:
break
;
}
}
// pobj.action_type = "submitIcpNeed";
if
(
!
pobj
.
area
)
{
return
self
.
getResultFail
(
"area参数错误"
);
}
var
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
()
,
requestUrl
:
"/icp/consultation/submit"
,
let
param
=
{
requestId
:
req
.
requestId
||
""
,
//
requestUrl: "/icp/consultation/submit",
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"submitIcpNeed"
,
//调用参数
//
pushUrl: "/action/intentionapi/springBoard",//调用地址
//
pushActionType: "submitIcpNeed",//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
version
:
1
,
interface_path
:
"service.receiveSve.icpNeedSve"
,
//接口路径
interface_method
:
"submitNeed"
,
//接口方法
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
s
elf
.
getResultSuccess
(
param
.
requestId
);
await
this
.
gatewaypushlogSve
.
create
(
param
);
return
s
ystem
.
getResultSuccess
(
null
);
}
}
module
.
exports
=
Consultation
;
\ No newline at end of file
center-channel/app/base/api/impl/icp/order.js
View file @
846ee4e8
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
let
APIBase
=
require
(
"../../api.base"
);
let
system
=
require
(
"../../../system"
);
let
settings
=
require
(
"../../../../config/settings"
);
/**
* icp通知接口(百度icp接入)
* 庄冰 2020.10.22
* 增值服务订单服务
*/
class
Order
extends
APIBase
{
constructor
()
{
...
...
@@ -12,207 +11,75 @@ class Order extends APIBase {
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
getResultSuccess
(
requestId
)
{
return
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
requestId
};
}
getResultFail
(
errmsg
)
{
var
self
=
this
;
return
{
"status"
:
-
1
,
"msg"
:
errmsg
,
"requestId"
:
self
.
getUUID
(),
"data"
:
null
,
"bizmsg"
:
"empty"
};
}
//icp状态变更
async
notify
(
pobj
,
obj
,
req
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
async
notify
(
pobj
,
obj
,
req
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
system
.
getResultFailByErrMsg
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
orderNo
)
{
return
self
.
getResultFail
(
"orderNo不能为空"
);
}
if
(
!
pobj
.
isDirectBuy
||
pobj
.
isDirectBuy
==
"0"
){
pobj
.
isDirectBuy
=
0
;
return
system
.
getResultFailByErrMsg
(
"orderNo不能为空"
);
}
pobj
.
isDirectBuy
=
pobj
.
isDirectBuy
||
0
;
//1是直购,0是下单未付款,算订单未付款需求
pobj
.
status
=
1
;
if
(
pobj
.
isDirectBuy
==
0
&&
!
pobj
.
bizId
)
{
return
self
.
getResultFail
(
"非直接下单bizId不能为空"
);
}
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
phone
)
{
return
self
.
getResultFail
(
"直接下单phone不能为空"
);
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
phone
)
{
return
system
.
getResultFailByErrMsg
(
"直接下单phone不能为空"
);
}
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
consultType
)
{
return
s
elf
.
getResultFail
(
"直接下单consultType不能为空"
);
}
else
{
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
consultType
)
{
return
s
ystem
.
getResultFailByErrMsg
(
"直接下单consultType不能为空"
);
}
else
{
if
(
pobj
.
consultType
==
"ICP"
)
{
pobj
.
consultType
=
"5"
;
}
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
}
}
pobj
.
action_type
=
"icpOrderStatus"
;
if
(
pobj
.
area
)
{
switch
(
pobj
.
area
)
{
case
"BEIJING"
:
pobj
.
area
=
"1"
;
break
;
case
"SHANGHAI"
:
pobj
.
area
=
"2"
;
break
;
case
"FUJIAN"
:
pobj
.
area
=
"3"
;
break
;
case
"GUANGXI"
:
pobj
.
area
=
"4"
;
break
;
case
"GUANGDONG"
:
pobj
.
area
=
"5"
;
break
;
case
"ANHUI"
:
pobj
.
area
=
"6"
;
break
;
case
"HENAN"
:
pobj
.
area
=
"7"
;
break
;
case
"HUBEI"
:
pobj
.
area
=
"8"
;
break
;
case
"ZHEJIANG"
:
pobj
.
area
=
"9"
;
break
;
case
"JIANGSU"
:
pobj
.
area
=
"10"
;
break
;
case
"SHANDONG"
:
pobj
.
area
=
"11"
;
break
;
case
"SHANGXI_SHAN"
:
pobj
.
area
=
"12"
;
break
;
case
"NINGXIA"
:
pobj
.
area
=
"13"
;
break
;
case
"GANSU"
:
pobj
.
area
=
"14"
;
break
;
case
"XINJIANG"
:
pobj
.
area
=
"15"
;
break
;
case
"QINGHAI"
:
pobj
.
area
=
"16"
;
break
;
case
"TIANJIN"
:
pobj
.
area
=
"17"
;
break
;
case
"CHONGQING"
:
pobj
.
area
=
"18"
;
break
;
case
"HEBEI"
:
pobj
.
area
=
"19"
;
break
;
case
"SHANXI_JIN"
:
pobj
.
area
=
"20"
;
break
;
case
"LIAONING"
:
pobj
.
area
=
"21"
;
break
;
case
"JINLIN"
:
pobj
.
area
=
"22"
;
break
;
case
"HEILONGJIANG"
:
pobj
.
area
=
"23"
;
break
;
case
"JIANGXI"
:
pobj
.
area
=
"24"
;
break
;
case
"HUNAN"
:
pobj
.
area
=
"25"
;
break
;
case
"SICHUAN"
:
pobj
.
area
=
"26"
;
break
;
case
"GUIZHOU"
:
pobj
.
area
=
"27"
;
break
;
case
"YUNNAN"
:
pobj
.
area
=
"28"
;
break
;
case
"NEIMENGGU"
:
pobj
.
area
=
"29"
;
break
;
case
"XIZANG"
:
pobj
.
area
=
"30"
;
break
;
case
"HANWAIZI"
:
pobj
.
area
=
"31"
;
break
;
case
"QUANWAIZI"
:
pobj
.
area
=
"31"
;
break
;
case
"WAIZI"
:
pobj
.
area
=
"31"
;
break
;
case
"HAINAN"
:
pobj
.
area
=
"34"
;
break
;
default
:
break
;
if
(
pobj
.
consultType
==
"EDI"
)
{
pobj
.
consultType
=
"7"
;
}
}
pobj
.
area
=
settings
.
areaConfig
[
pobj
.
area
];
// pobj.action_type = "icpOrderStatus";
if
(
!
pobj
.
area
)
{
return
self
.
getResultFail
(
"area参数错误"
);
}
var
param
=
{
let
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
(),
requestUrl
:
"/icp/order/notify"
,
//
requestUrl: "/icp/order/notify",
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"icpOrderStatus"
,
//调用参数
//
pushUrl: "/action/intentionapi/springBoard",//调用地址
//
pushActionType: "icpOrderStatus",//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
version
:
1
,
interface_path
:
"service.receiveSve.icpOrderSve"
,
//接口路径
interface_method
:
"submitOrder"
,
//接口方法
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
s
elf
.
getResultSuccess
(
param
.
requestId
);
await
this
.
gatewaypushlogSve
.
create
(
param
);
return
s
ystem
.
getResultSuccess
(
null
);
}
async
close
(
pobj
,
obj
,
req
){
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
async
close
(
pobj
,
obj
,
req
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
system
.
getResultFailByErrMsg
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
orderNo
)
{
return
s
elf
.
getResultFail
(
"orderNo不能为空"
);
return
s
ystem
.
getResultFailByErrMsg
(
"orderNo不能为空"
);
}
pobj
.
channelOrderNo
=
pobj
.
orderNo
;
pobj
.
action_type
=
"icpOrderClose"
;
var
param
=
{
//
pobj.action_type = "icpOrderClose";
let
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
(),
requestUrl
:
"/icp/order/close"
,
//
requestUrl: "/icp/order/close",
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"icpOrderClose"
,
//调用参数
//
pushUrl: "/action/intentionapi/springBoard",//调用地址
//
pushActionType: "icpOrderClose",//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
version
:
1
,
interface_path
:
"service.receiveSve.icpOrderSve"
,
//接口路径
interface_method
:
"closeOrder"
,
//接口方法
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
s
elf
.
getResultSuccess
(
param
.
requestId
);
await
this
.
gatewaypushlogSve
.
create
(
param
);
return
s
ystem
.
getResultSuccess
(
null
);
}
}
module
.
exports
=
Order
;
\ No newline at end of file
center-channel/app/base/db/metadata/apps/platform.js
View file @
846ee4e8
...
...
@@ -16,12 +16,10 @@ module.exports = {
// },
],
},
"bizs"
:
{
},
"bizs"
:
{},
"pdict"
:
{
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
"push_return_type"
:
{
"0"
:
"推送失败"
,
"1"
:
"推送成功"
},
}
,
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
"push_return_type"
:
{
"0"
:
"推送失败"
,
"1"
:
"推送成功"
},
}
}
}
\ No newline at end of file
center-channel/app/base/db/models/common/gatewaypushlog.js
View file @
846ee4e8
...
...
@@ -2,58 +2,58 @@ const system = require("../../../system");
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"gatewaypushlog"
,
{
requestId
:
DataTypes
.
STRING
,
requestUrl
:
DataTypes
.
STRING
,
//请求地址
requestjson
:
DataTypes
.
STRING
,
//请求地址
pushUrl
:
DataTypes
.
STRING
,
//调用地址
pushActionType
:
DataTypes
.
STRING
,
//调用参数
pushtimes
:
DataTypes
.
INTEGER
,
//推送次数
pushStatus
:
DataTypes
.
STRING
,
//推送状态
error
:
DataTypes
.
STRING
(
5000
),
//错误信息
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
fals
e
,
//freezeTableName
: true,
// define the table's name
tableName
:
'gateway_pushlog'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
return
db
.
define
(
"gatewaypushlog"
,
{
requestId
:
DataTypes
.
STRING
,
requestUrl
:
DataTypes
.
STRING
,
//请求地址
requestjson
:
DataTypes
.
STRING
,
//请求地址
pushUrl
:
DataTypes
.
STRING
,
//调用地址
pushActionType
:
DataTypes
.
STRING
,
//调用参数
pushtimes
:
DataTypes
.
INTEGER
,
//推送次数
pushStatus
:
DataTypes
.
STRING
,
//推送状态
error
:
DataTypes
.
STRING
(
5000
),
//错误信息
interface_path
:
DataTypes
.
STRING
(
1024
),
//接口路径
interface_method
:
DataTypes
.
STRING
,
//接口方法
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
tru
e
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true
,
// define the table's name
tableName
:
'gateway_pushlog'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
center-channel/app/base/service/impl/receiveSve/icpNeedSve.js
0 → 100644
View file @
846ee4e8
let
system
=
require
(
"../../../system"
);
let
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
class
IcpNeedService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
async
submitNeed
(
pobj
)
{
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,6000001"
);
}
let
sobj
=
pobj
;
sobj
.
actionType
=
"getProductTypeInfo"
;
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
let
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败,6000002"
);
}
let
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败6000003"
);
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
// pobj.actionBody.type = "baidu.icp";
// pobj.actionBody.idempotentSource = "baidu_icp";
//推送云服需要的type、idempotentSource两个参数确定,先去掉试一试
// if (pobj.actionBody.channel_type_code == 5) {
// pobj.actionBody.type = "baidu.icp";
// pobj.actionBody.idempotentSource = "baidu_icp";
// } else if (pobj.actionBody.channel_type_code == 7) {
// pobj.actionBody.type = "baidu.edi";
// pobj.actionBody.idempotentSource = "baidu_edi";
// } else if (pobj.actionBody.channel_type_code == "NC") {
// pobj.actionBody.type = "baidu.wangwen";
// pobj.actionBody.idempotentSource = "baidu_wangwen";
// } else if (pobj.actionBody.channel_type_code == "RT") {
// pobj.actionBody.type = "baidu.radiotv";
// pobj.actionBody.idempotentSource = "baidu_radiotv";
// }
// if (pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id == "52") {
// if (pobj.actionBody.channel_type_code == 5) {
// pobj.actionBody.type = "yiming.icp";
// pobj.actionBody.idempotentSource = "yiming.icp";
// } else if (pobj.actionBody.channel_type_code == 7) {
// pobj.actionBody.type = "yiming.edi";
// pobj.actionBody.idempotentSource = "yiming.edi";
// } else if (pobj.actionBody.channel_type_code == "ICPNB") {
// pobj.actionBody.type = "yiming.icpnb";
// pobj.actionBody.idempotentSource = "yiming.icpnb";
// } else if (pobj.actionBody.channel_type_code == "EDINB") {
// pobj.actionBody.type = "yiming.edinb";
// pobj.actionBody.idempotentSource = "yiming.edinb";
// } else if (pobj.actionBody.channel_type_code == "ICPXQ") {
// pobj.actionBody.type = "yiming.icpxq";
// pobj.actionBody.idempotentSource = "yiming.icpxq";
// } else if (pobj.actionBody.channel_type_code == "EDIXQ") {
// pobj.actionBody.type = "yiming.edixq";
// pobj.actionBody.idempotentSource = "yiming.edixq";
// }
// //外资暂时产品库未上架
// else if (pobj.actionBody.channel_type_code == "ICPWZ") {
// pobj.actionBody.type = "yiming.icpwz";
// pobj.actionBody.idempotentSource = "yiming.icpwz";
// } else if (pobj.actionBody.channel_type_code == "EDIWZ") {
// pobj.actionBody.type = "yiming.ediwz";
// pobj.actionBody.idempotentSource = "yiming.ediwz";
// }
// }
pobj
.
actionBody
.
level
=
"A"
;
pobj
.
actionType
=
"submitNeed"
;
let
reqUrl
=
settings
.
centerOrderUrl
()
+
"action/need/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
this
.
utilsPushSve
.
business2Channel
(
pobj
,
"pushNeedICPBusinessNew"
);
}
return
result
;
}
}
module
.
exports
=
IcpNeedService
;
\ No newline at end of file
center-channel/app/base/service/impl/receiveSve/icpOrderSve.js
0 → 100644
View file @
846ee4e8
let
system
=
require
(
"../../../system"
);
let
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
class
IcpOrderService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
async
submitOrder
(
pobj
)
{
pobj
.
province
=
pobj
.
area
;
if
(
pobj
.
appInfo
.
uapp_id
==
"52"
)
{
// 易名渠道
if
(
pobj
.
consultType
==
"5"
||
pobj
.
consultType
==
"7"
)
{
// ICP 申请
pobj
.
province
=
pobj
.
area
+
'-申请'
;
}
}
let
sobj
=
{
actionType
:
"getIcpProduce"
,
actionBody
:
{
typeCode
:
pobj
.
actionBody
.
consultType
,
province
:
pobj
.
province
},
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
if
(
pobj
.
param1
||
pobj
.
param2
)
{
sobj
.
additionsDesc
=
pobj
.
param1
+
pobj
.
param2
;
}
//附加参数
let
productUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
let
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
productUrl
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败,6100001"
);
}
let
productItem
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
productItem
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败,6100002"
);
}
pobj
.
actionBody
.
totalSum
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
orderPrice
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
payTotalSum
=
productItem
.
data
.
price
;
pobj
.
actionBody
.
payCode
=
productItem
.
data
.
payCode
;
pobj
.
actionBody
.
productPriceId
=
productItem
.
data
.
productPriceId
;
pobj
.
actionBody
.
channelItemCode
=
productItem
.
data
.
channelItemCode
;
pobj
.
actionBody
.
channelNeedNo
=
productItem
.
data
.
channelNeedNo
;
pobj
.
actionBody
.
needNo
=
productItem
.
data
.
needNo
;
pobj
.
actionBody
.
quantity
=
1
;
pobj
.
actionBody
.
channelOrder
=
{
channelServiceNo
:
pobj
.
actionBody
.
orderNo
,
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
orderStatus
:
2
}
let
orderItem
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderItem
.
status
!=
0
&&
orderItem
.
status
!=
-
1
)
{
return
system
.
getResultFail
(
-
5010
,
"订单创建失败,6100003"
);
}
if
(
orderItem
.
data
)
{
pobj
.
actionBody
.
orderNo
=
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
;
}
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
orderNo
;
pobj
.
actionType
=
"receiveSolutionPayInfoNew"
;
let
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
let
solutionRes
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
if
(
!
solutionRes
||
!
solutionRes
.
stdout
)
{
return
system
.
getResultFail
(
-
5010
,
"方案创建失败,6100004"
);
}
let
solutionItem
=
JSON
.
parse
(
solutionRes
.
stdout
);
if
(
solutionItem
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5010
,
"方案创建失败,6100005"
);
}
// if (!solutiondata.data) {
// return system.getResultFail(-5012, "方案查询数据为空");
// }
// if (solutiondata.data && solutiondata.data.channelNeedNo) {
// pobj.actionBody.needId = solutiondata.data.channelNeedNo;
// }
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "baidu.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "baidu.edi";
// } else if (pobj.actionBody.channelItemCode == 'NC') {
// pobj.actionBody.regType = "baidu.wangwen";
// } else if (pobj.actionBody.channelItemCode == 'RT') {
// pobj.actionBody.regType = "baidu.radiotv";
// }
//
// if (pobj && pobj.appInfo && pobj.appInfo.uapp_id && pobj.appInfo.uapp_id == '52') {
// if (pobj.actionBody.channelItemCode == '5') {
// pobj.actionBody.regType = "yiming.icp";
// } else if (pobj.actionBody.channelItemCode == '7') {
// pobj.actionBody.regType = "yiming.edi";
// } else if (pobj.actionBody.channelItemCode == 'ICPXQ') {
// pobj.actionBody.regType = "yiming.icpxq";
// } else if (pobj.actionBody.channelItemCode == 'EDIXQ') {
// pobj.actionBody.regType = "yiming.edixq";
// } else if (pobj.actionBody.channelItemCode == 'ICPNB') {
// pobj.actionBody.regType = "yiming.icpnb";
// } else if (pobj.actionBody.channelItemCode == 'EDINB') {
// pobj.actionBody.regType = "yiming.edinb";
// } else if (pobj.actionBody.channelItemCode == 'ICPWZ') {
// pobj.actionBody.regType = "yiming.icpwz";
// } else if (pobj.actionBody.channelItemCode == 'EDIWZ') {
// pobj.actionBody.regType = "yiming.ediwz";
// }
// }
let
yfObj
=
{
actionBody
:
{
area
:
pobj
.
actionBody
.
province
,
idempotentSource
:
pobj
.
actionBody
.
regType
,
orderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
orderPrice
:
Number
(
pobj
.
actionBody
.
orderPrice
/
100
),
phone
:
pobj
.
actionBody
.
publishMobile
,
needId
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
companyName
:
pobj
.
actionBody
.
CompanyName
||
''
,
appName
:
pobj
.
appInfo
.
app_name
||
''
,
sku
:
data
.
data
.
service_code
||
''
},
appInfo
:
pobj
.
appInfo
}
let
yunfuPushRes
=
await
this
.
utilsPushSve
.
business2Channel
(
yfObj
,
"pushOrderICPBusinessNew"
);
if
(
pobj
.
actionBody
.
isDirectBuy
&&
pobj
.
actionBody
.
isDirectBuy
==
1
)
{
//直接下单需执行添加订单业务员操作
if
(
yunfuPushRes
&&
yunfuPushRes
.
status
==
0
)
{
if
(
yunfuPushRes
.
data
&&
yunfuPushRes
.
data
.
data
)
{
let
deliveryObj
=
{
actionBody
:
{
orderNo
:
yunfuPushRes
.
data
.
orderNo
,
needsolution
:
yunfuPushRes
.
data
.
solutionContent
,
channelNeedNo
:
yunfuPushRes
.
data
.
channelNeedNo
,
channelSolutionNo
:
yunfuPushRes
.
data
.
channelSolutionNo
,
skuCode
:
data
.
data
.
payCode
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
}
},
appInfo
:
pobj
.
appInfo
};
let
resData
=
yunfuPushRes
.
data
.
data
;
let
salesmanInfo
=
{
salesmanName
:
resData
.
orderList
&&
resData
.
orderList
.
length
>
0
?
resData
.
orderList
[
0
].
operatorName
:
""
,
salesmanChannelId
:
resData
.
orderList
&&
resData
.
orderList
.
length
>
0
?
resData
.
orderList
[
0
].
operator
:
""
,
};
deliveryObj
.
actionBody
.
needsolution
=
{
salesmanInfo
:
salesmanInfo
,
orderNo
:
orderrtn
.
data
.
orderNo
}
this
.
utilsPushSve
.
business2Channel
(
deliveryObj
,
"pushDeliveryOrder"
);
}
}
}
return
system
.
getResultSuccess
(
null
);
}
async
closeOrder
(
pobj
)
{
let
actionBody
=
pobj
.
actionBody
;
let
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
let
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
rtn
.
status
==
0
&&
rtn
.
data
)
{
let
channelOrderNo
=
pobj
.
actionBody
.
orderNo
;
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
pobj
.
actionType
=
"delOrder"
;
let
orderrtn
=
await
this
.
utilsOrderSve
.
delOrder
(
pobj
,
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
let
tmpObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
business2Channel
(
tmpObj
,
"pushDeliveryStatusNotify"
);
// tmpObj.actionBody.orderNo = channelOrderNo;
let
tmpObj2
=
{
actionBody
:
{
orderNo
:
channelOrderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
||
channelOrderNo
,
//做云服和企服通没有渠道需求号的兼容
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
};
this
.
utilsPushSve
.
business2Channel
(
tmpObj2
,
"pushOrderICPClose"
);
}
//通知更新状态
return
rtn
;
}
}
module
.
exports
=
IcpOrderService
;
\ No newline at end of file
center-channel/app/base/system.js
View file @
846ee4e8
...
...
@@ -218,6 +218,13 @@ class System {
data
:
data
,
};
}
static
getResultFailByErrMsg
(
errmsg
=
"fail"
)
{
return
{
status
:
-
1
,
msg
:
errmsg
,
data
:
""
,
};
}
/**
* 请求返回失败
...
...
center-channel/app/config/routes/api.js
View file @
846ee4e8
...
...
@@ -6,7 +6,7 @@ const utilsFeishuSve = system.getObject("service.utilsSve.utilsFeishuSve");
const
signSve
=
system
.
getObject
(
"service.common.signSve"
);
const
xml2js
=
require
(
'xml2js'
);
const
jwt
=
require
(
'jsonwebtoken'
);
const
{
PDICT
}
=
require
(
"../../config/businessConfig"
);
const
{
PDICT
}
=
require
(
"../../config/businessConfig"
);
const
settings
=
require
(
"../../config/settings"
);
module
.
exports
=
function
(
app
)
{
...
...
@@ -243,7 +243,7 @@ module.exports = function (app) {
return
;
}
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
,
"queryTradeProduceList"
,
"getNeedComparisonList"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
,
"queryTradeProduceList"
,
"getNeedComparisonList"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
next
();
return
;
...
...
@@ -394,32 +394,29 @@ module.exports = function (app) {
//-----------------------新的模式---------api---------开始
//百度手动获取签名sign方法
// app.post("/baidu/creatSign", async function (req, res, next) {
// if (!req.body.key) {
// res.end({ code: -200, message: "缺少加签秘钥key参数" });
// return;
// }
// if (!req.body.obj) {
// res.end({ code: -200, message: "缺少obj参数" });
// return;
// }
// let obj = req.body.obj;
// let key = req.body.key;
// let result = await signSve.createSign(obj, key);
// res.end(JSON.stringify(result));
// return;
// });
app
.
post
(
"/baidu/creatSign"
,
async
function
(
req
,
res
,
next
)
{
if
(
!
req
.
body
.
key
)
{
res
.
end
({
code
:
-
200
,
message
:
"缺少加签秘钥key参数"
});
return
;
}
if
(
!
req
.
body
.
obj
)
{
res
.
end
({
code
:
-
200
,
message
:
"缺少obj参数"
});
return
;
}
let
obj
=
req
.
body
.
obj
;
let
key
=
req
.
body
.
key
;
let
result
=
await
signSve
.
createSign
(
obj
,
key
);
res
.
end
(
JSON
.
stringify
(
result
));
return
;
});
app
.
all
(
"/api/*"
,
async
function
(
req
,
res
,
next
)
{
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
let
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
console
.
log
(
req
.
originalUrl
,
"sy-------------------------------00001---yy"
)
;
let
appkey
=
req
.
headers
[
"appkey"
]
||
""
;
if
(
PDICT
.
apiAliSendKeyPathList
.
indexOf
(
req
.
originalUrl
)
>=
0
)
{
//验证数据key
var
appkey
=
req
.
headers
[
"appkey"
]
||
""
;
if
(
!
appkey
)
{
result
.
msg
=
"req headers appkey can not be empty"
;
result
.
data
=
null
;
...
...
@@ -434,18 +431,16 @@ module.exports = function (app) {
}
next
();
return
;
}
}
//规定的请求path、请求头中appkey验证是否等于201912031344的路由【符合放过】
if
(
PDICT
.
apiSecretPathList
.
indexOf
(
req
.
originalUrl
)
>=
0
)
{
//验证数据签名
console
.
log
(
"apiSecretPathList"
,
req
.
headers
)
var
appkey
=
req
.
headers
[
"appkey"
]
||
""
;
if
(
!
appkey
)
{
result
.
msg
=
"req headers appkey can not be empty"
;
result
.
data
=
null
;
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
sign
=
req
.
headers
[
"sign"
]
||
""
;
let
sign
=
req
.
headers
[
"sign"
]
||
""
;
if
(
!
sign
)
{
result
.
msg
=
"req headers sign can not be empty"
;
result
.
data
=
null
;
...
...
@@ -453,18 +448,17 @@ module.exports = function (app) {
return
;
}
//1.通过appkey 获取appInfo
var
appRes
=
await
signSve
.
getAppInfoByAppKey
(
appkey
);
let
appRes
=
await
signSve
.
getAppInfoByAppKey
(
appkey
);
if
(
!
appRes
||
appRes
.
status
!=
0
)
{
result
.
msg
=
"获取应用信息失败"
;
result
.
data
=
null
;
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
appInfo
=
appRes
.
data
;
let
appInfo
=
appRes
.
data
;
//2.通过appsecret 验签
req
.
body
.
sign
=
sign
;
var
signParams
=
req
.
body
;
var
verifyRes
=
await
signSve
.
verifySign
(
req
.
body
,
appInfo
.
uapp_secret
);
let
verifyRes
=
await
signSve
.
verifySign
(
req
.
body
,
appInfo
.
uapp_secret
);
if
(
verifyRes
&&
verifyRes
.
status
==
0
)
{
req
.
body
.
appInfo
=
appInfo
;
req
.
appInfo
=
appInfo
;
...
...
@@ -476,22 +470,27 @@ module.exports = function (app) {
return
;
}
}
}
//规定的请求path、请求头中sign验证的路由【符合放过】
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"getTmNclFilterSearch"
,
"feedback"
,
"accountingInfo"
,
"booksInfo"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
next
();
return
;
}
}
//规定的actionType请求路由,有getAppTokenByAppKey获取请求头中token【符合放过】
if
(
req
.
path
.
indexOf
(
"/taskapi/"
)
>=
0
)
{
next
();
return
;
}
}
//任务请求的路由【符合放过】
if
(
!
req
.
body
.
actionType
)
{
result
.
msg
=
"actionType can not be empty"
;
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
token
=
req
.
headers
[
"token"
]
||
""
;
}
//actionType不能为空
//验证请求头中的token-------------------------------------------------开始
let
token
=
req
.
headers
[
"token"
]
||
""
;
if
(
!
token
)
{
result
.
msg
=
"req headers token can not be empty"
;
result
.
data
=
null
;
...
...
@@ -515,14 +514,8 @@ module.exports = function (app) {
let
tmpAppInfo
=
JSON
.
parse
(
decryptResult
.
data
);
req
.
body
.
appInfo
=
tmpAppInfo
;
req
.
body
.
actionProcess
=
tmpAppInfo
.
app_code
;
// var cacheManager = system.getObject("db.common.cacheManager");
// var result = await cacheManager["AppTokenByHostsCache"].getCache(token, system.exTime);
// if (result.status != 0) {
// res.end(JSON.stringify(result));
// return;
// }
// req.body.appInfo = result.data;
// req.body.actionProcess = result.data.app_code;
//验证请求头中的token-------------------------------------------------结束
if
(
PDICT
.
apiMustUserpinList
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
if
(
!
userpin
)
{
...
...
@@ -532,20 +525,6 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
// var params = {
// "appInfo": req.body.appInfo,
// "actionType": "getLoginInfo",
// "actionBody": {
// "userpin": userpin
// }
// }
// result = await utilsAuthSve.getLoginInfo(params, params.actionBody);
// if (result.status != 0) {
// result.status = system.noLogin;
// result.msg = "user login is invalidation";
// res.end(JSON.stringify(result));
// return;
// }
let
userpin_secret_str
=
null
;
jwt
.
verify
(
userpin
,
tokenSecret
,
function
(
err
,
decoded
)
{
// decoded:指的是token解码后用户信息
if
(
err
)
{
//如果token过期则会执行err的代码块
...
...
@@ -565,7 +544,7 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
}
//需要
用户登录
}
//需要
设置用户登录的actionType请求验证
next
();
});
...
...
@@ -624,6 +603,8 @@ module.exports = function (app) {
});
//-----------------------新的模式---------api---------结束
//-----------------------新的模式---------ICP---------开始
app
.
all
(
"/icp/*"
,
async
function
(
req
,
res
,
next
)
{
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
...
...
center-channel/app/config/settings.js
View file @
846ee4e8
...
...
@@ -3,465 +3,541 @@ var AlipaySdk = require('alipay-sdk').default;
var
WXPay
=
require
(
'wx-pay'
);
// const tenpay = require('tenpay');
var
ENVINPUT
=
{
DB_HOST
:
process
.
env
.
DB_HOST
,
DB_PORT
:
process
.
env
.
DB_PORT
,
DB_USER
:
process
.
env
.
DB_USER
,
DB_PWD
:
process
.
env
.
DB_PWD
,
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
DB_NAME
:
process
.
env
.
CENTER_CHANNEL_DB_NAME
,
REDIS_DB
:
process
.
env
.
CENTER_CHANNEL_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
DB_HOST
:
process
.
env
.
DB_HOST
,
DB_PORT
:
process
.
env
.
DB_PORT
,
DB_USER
:
process
.
env
.
DB_USER
,
DB_PWD
:
process
.
env
.
DB_PWD
,
REDIS_HOST
:
process
.
env
.
REDIS_HOST
,
REDIS_PORT
:
process
.
env
.
REDIS_PORT
,
REDIS_PWD
:
process
.
env
.
REDIS_PWD
,
DB_NAME
:
process
.
env
.
CENTER_CHANNEL_DB_NAME
,
REDIS_DB
:
process
.
env
.
CENTER_CHANNEL_REDIS_DB
,
APP_ENV
:
process
.
env
.
APP_ENV
?
process
.
env
.
APP_ENV
:
"dev"
};
var
settings
=
{
env
:
ENVINPUT
.
APP_ENV
,
appKey
:
"201911061250"
,
secret
:
"f99d413b767f09b5dff0b3610366cc46"
,
salt
:
"%iatpD1gcxz7iF#B"
,
cacheprefix
:
"centerChannel"
,
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4012
,
//记录日志地址
opNewLogUrl
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://er.es.gongsibao.com:7200/center_channel_req_log/_doc?pretty"
;
}
// return "http://43.247.184.94:7200/center_channel_req_log/_doc?pretty";
return
"http://er.es.gongsibao.com:7200/center_channel_req_log/_doc?pretty"
},
enameClientUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"https://ote.ename.com/icp/"
;
//开发
}
else
{
return
"https://api.ename.com/icp/"
;
//线上
}
},
//百度icp、edi、nc、rt
baiduClientParams
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
{
domain
:
"https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
,
//开发
accessKey
:
"ed0f5c4c7c2d4e87aa335d9b07bf9bd4"
,
secretKey
:
"f600c4e91f6d43998d637401e6e34ef9"
,
host
:
"gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
};
}
return
{
domain
:
"https://gwgp-nbzljnwusrw.i.bdcloudapi.com"
,
//线上
accessKey
:
"0e5abf33ef07457f8dbd779287747c0c"
,
secretKey
:
"9d86f04a85db4cdfa95ba8ad28009188"
,
host
:
"gwgp-nbzljnwusrw.i.bdcloudapi.com"
};
},
//百度工商注册
baiduRegClientParams
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
{
domain
:
"https://gwgp-fpxfeempcfz.i.bdcloudapi.com"
,
//开发
//2021-5-20废弃
// accessKey:"047935a96ee14ca7a79529fe0688f7dc",
// secretKey:"2290966ca6ef4b308c90d720263ec9f7",
//2021-5-20新增
accessKey
:
"aa3e1adec5644053ba29918fbbbd91c1"
,
secretKey
:
"15ce98c24b5b4c95b456530a0891e521"
,
host
:
"gwgp-fpxfeempcfz.i.bdcloudapi.com"
};
}
return
{
domain
:
"https://gwgp-rqmgxmmgt8y.i.bdcloudapi.com"
,
//线上
accessKey
:
"0e5abf33ef07457f8dbd779287747c0c"
,
secretKey
:
"9d86f04a85db4cdfa95ba8ad28009188"
,
host
:
"gwgp-rqmgxmmgt8y.i.bdcloudapi.com"
};
},
//工商核名请求接口配置
checkIcNameUrl
()
{
if
(
this
.
env
===
'localhost'
)
{
return
'http://127.0.0.1:35502/IcName/CheckName'
;
}
return
'http://ic-name-service/IcName/CheckName'
;
},
fbQueryUrl
:
function
()
{
if
(
this
.
env
==
'dev'
||
this
.
env
==
'test'
)
{
return
'http://43.247.184.92:15505'
}
else
{
return
'http://43.247.184.92:15505'
}
},
opPushQueueUrl
:
function
()
{
if
(
this
.
env
==
"dev"
||
this
.
env
==
"test"
)
{
// return "http://192.168.18.101:4018/api/queueAction/producer/springBoard";
// 2020 1112 lin修改 替换为线上测试队列环境。经过宋哥批准。兴业提供的地址
return
"http://gsbqueue.frp.sxy97.xyz/api/queueAction/producer/springBoard"
}
else
{
return
"http://sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
},
entProfileUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://entprofile.gongsibao.com/"
;
}
else
{
return
"https://entprofile.gongsibao.com/"
;
}
},
aliossjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://aliossjava-service/uploadfile"
;
}
},
aliGetNamesjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:80/getNames"
;
}
else
{
return
"http://aliossjava-service/getNames"
;
}
env
:
ENVINPUT
.
APP_ENV
,
appKey
:
"201911061250"
,
secret
:
"f99d413b767f09b5dff0b3610366cc46"
,
salt
:
"%iatpD1gcxz7iF#B"
,
cacheprefix
:
"centerChannel"
,
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4012
,
//记录日志地址
opNewLogUrl
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://er.es.gongsibao.com:7200/center_channel_req_log/_doc?pretty"
;
}
// return "http://43.247.184.94:7200/center_channel_req_log/_doc?pretty";
return
"http://er.es.gongsibao.com:7200/center_channel_req_log/_doc?pretty"
},
enameClientUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"https://ote.ename.com/icp/"
;
//开发
}
else
{
return
"https://api.ename.com/icp/"
;
//线上
}
},
//百度icp、edi、nc、rt
baiduClientParams
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
{
domain
:
"https://gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
,
//开发
accessKey
:
"ed0f5c4c7c2d4e87aa335d9b07bf9bd4"
,
secretKey
:
"f600c4e91f6d43998d637401e6e34ef9"
,
host
:
"gwgp-mwnn9gk4o4e.i.bdcloudapi.com"
};
}
return
{
domain
:
"https://gwgp-nbzljnwusrw.i.bdcloudapi.com"
,
//线上
accessKey
:
"0e5abf33ef07457f8dbd779287747c0c"
,
secretKey
:
"9d86f04a85db4cdfa95ba8ad28009188"
,
host
:
"gwgp-nbzljnwusrw.i.bdcloudapi.com"
};
},
//百度工商注册
baiduRegClientParams
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
{
domain
:
"https://gwgp-fpxfeempcfz.i.bdcloudapi.com"
,
//开发
//2021-5-20废弃
// accessKey:"047935a96ee14ca7a79529fe0688f7dc",
// secretKey:"2290966ca6ef4b308c90d720263ec9f7",
//2021-5-20新增
accessKey
:
"aa3e1adec5644053ba29918fbbbd91c1"
,
secretKey
:
"15ce98c24b5b4c95b456530a0891e521"
,
host
:
"gwgp-fpxfeempcfz.i.bdcloudapi.com"
};
}
return
{
domain
:
"https://gwgp-rqmgxmmgt8y.i.bdcloudapi.com"
,
//线上
accessKey
:
"0e5abf33ef07457f8dbd779287747c0c"
,
secretKey
:
"9d86f04a85db4cdfa95ba8ad28009188"
,
host
:
"gwgp-rqmgxmmgt8y.i.bdcloudapi.com"
};
},
//工商核名请求接口配置
checkIcNameUrl
()
{
if
(
this
.
env
===
'localhost'
)
{
return
'http://127.0.0.1:35502/IcName/CheckName'
;
}
return
'http://ic-name-service/IcName/CheckName'
;
},
},
tmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://center-tmtransaction-service"
;
}
},
fbQueryUrl
:
function
()
{
if
(
this
.
env
==
'dev'
||
this
.
env
==
'test'
)
{
return
'http://43.247.184.92:15505'
}
else
{
return
'http://43.247.184.92:15505'
}
},
opPushQueueUrl
:
function
()
{
if
(
this
.
env
==
"dev"
||
this
.
env
==
"test"
)
{
// return "http://192.168.18.101:4018/api/queueAction/producer/springBoard";
// 2020 1112 lin修改 替换为线上测试队列环境。经过宋哥批准。兴业提供的地址
return
"http://gsbqueue.frp.sxy97.xyz/api/queueAction/producer/springBoard"
}
else
{
return
"http://sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
},
entProfileUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://entprofile.gongsibao.com/"
;
}
else
{
return
"https://entprofile.gongsibao.com/"
;
}
},
aliossjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://aliossjava-service/uploadfile"
;
}
},
aliGetNamesjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:80/getNames"
;
}
else
{
return
"http://aliossjava-service/getNames"
;
}
qifuPayAfterH5JumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
}
else
{
return
"http://tm.qifu.gongsibao.com/#/home/indent_list"
;
}
},
qifuPayAfterPcJumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
}
else
{
return
"http://tm.qifu.gongsibao.com/#/home/indent_list"
;
}
},
qifuH5PayNotifyUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
// return "http://gsb.qifu.gongsibao.com:4012/tlpay/notify";
return
"http://gsb.qifu-dev.gongsibao.com/tlpay/notify"
// 2020 0804 lin 修改测试环境tl回调地址
}
else
{
return
"http://gsb.qifu.gongsibao.com/tlpay/notify"
;
}
},
qifubaoUrl
:
function
()
{
//企服宝(交付系统)
if
(
this
.
env
==
"dev"
)
{
return
"http://xxxx:xxxx/"
;
}
else
{
return
""
;
}
},
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://p.apps.com:4001/"
;
}
else
{
return
"https://open.gongsibao.com/"
;
}
},
centerAppUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerapp.apps.com:4010/"
;
}
else
{
return
"http://center-app-service/"
;
}
},
centerTmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerTmtransactioon.apps.com:4006/"
;
}
else
{
return
"http://center-tmtransaction-service/"
;
}
},
zzzdUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://106.13.228.212:80"
;
}
else
{
return
"http://qualitydoctor-service/"
;
}
},
// 2020 0807 lin 新增 营业执照识别请求地址
// 2020 0813 lin 修改 增加王昆给的正式环境地址
businessDistinguishUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://43.247.184.92:15504/"
}
else
{
return
"http://172.17.149.71:32505/"
}
},
// 2020 0810 lin 新增 四要素验证请求地址
fourFactorsUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://39.107.234.14:8026/bpo-sign/"
;
}
else
{
// 正式环境没给
}
},
centerChannelUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:4012/"
}
else
{
// return "channel的正式环境" 6.30修改目前只用作生成alipay/wx的通知回调地址
return
"http://youke.qifu.gongsibao.com/"
}
},
gatewayUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:4005/"
;
}
else
{
return
"https://channelgateway-api.gongsibao.com/"
;
}
},
centerOrderUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerorder.apps.com:4011/"
;
}
else
{
return
"http://center-order-service/"
;
}
},
igirlWeburl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://127.0.0.1:3000/"
;
}
else
{
return
"http://igirl-service/"
;
}
},
centerCacheUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://123.57.217.203:30005/"
;
}
else
{
return
"http://specialprofile-service/"
}
},
fileDealUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://43.247.184.92:15503"
;
}
else
{
return
"http://43.247.184.92:15503"
}
},
reqTransferurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.61:3003/"
;
}
else
{
return
"http://jiaxiya-service/"
;
}
},
reqEsAddr
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
"http://43.247.184.94:7200/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://43.247.184.94:7200/"
;
}
},
certificationUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://43.247.184.92:15506/"
;
//
}
else
{
return
"http://43.247.184.92:15506/"
;
}
},
reqZcApi
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://zcapi.apps.com:4002/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://zcapi-service/"
;
//k8s服务名称
}
},
pushFqbossDataUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.141:3000/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"https://fqgirl.gongsibao.com/"
;
}
},
fqbossTmUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://fqgirlstage.gongsibao.com/api/tmsub/channelTmNotify"
}
else
{
return
"https://fqgirl.gongsibao.com/api/tmsub/channelTmNotify"
}
},
ucommuneUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://m-dev.ucommune.com/"
// 优客测试环境
}
else
{
// return "https://m.ucommune.com/"// 优客正式环境
return
"https://m.ucommune.com/"
// 6.29lin修改为测试环境。原因优客 目前还没有正式环境
}
},
tokenUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://oauth2.e.360.cn/site/token"
// 360测试环境
}
else
{
return
"https://oauth2.e.360.cn/site/token"
//
}
},
requestUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38085/"
// 360测试环境
}
else
{
return
"https://console.e.360.cn/"
//
}
},
pushUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38086/"
// 360测试环境
}
else
{
return
"https://tobadmin.e.360.cn/"
//
}
},
aliUappId
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
18
// uapp_id
}
else
{
return
18
// uapp_id
}
},
icNameUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://fqdev.gongsibao.com/"
}
else
{
return
"https://fq.gongsibao.com/"
}
},
openPlatformAK
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
{
"accessKey"
:
"111"
,
"accessSecret"
:
"222"
}
}
else
{
return
{
"accessKey"
:
"202101121716"
,
"accessSecret"
:
"12bb846776874167b5c7e01cd0116c12"
}
}
},
apiconfig
:
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"center_channel_log/_doc?pretty"
;
},
opLogEsIsAdd
:
function
()
{
return
1
;
tmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://center-tmtransaction-service"
;
}
},
},
homePage
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
reqHomePageDevUrl
;
}
else
{
return
"http://boss.gongsibao.com/"
;
}
},
redis
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
redis
;
}
else
{
return
{
host
:
ENVINPUT
.
REDIS_HOST
,
port
:
ENVINPUT
.
REDIS_PORT
,
password
:
ENVINPUT
.
REDIS_PWD
,
db
:
ENVINPUT
.
REDIS_DB
,
};
}
},
database
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
database
;
}
else
{
return
{
dbname
:
ENVINPUT
.
DB_NAME
,
user
:
ENVINPUT
.
DB_USER
,
password
:
ENVINPUT
.
DB_PWD
,
config
:
{
host
:
ENVINPUT
.
DB_HOST
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
max
:
5
,
min
:
0
,
acquire
:
90000000
,
idle
:
1000000
},
debug
:
false
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
qifuPayAfterH5JumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
}
else
{
return
"http://tm.qifu.gongsibao.com/#/home/indent_list"
;
}
},
qifuPayAfterPcJumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
}
else
{
return
"http://tm.qifu.gongsibao.com/#/home/indent_list"
;
}
},
qifuH5PayNotifyUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
// return "http://gsb.qifu.gongsibao.com:4012/tlpay/notify";
return
"http://gsb.qifu-dev.gongsibao.com/tlpay/notify"
// 2020 0804 lin 修改测试环境tl回调地址
}
else
{
return
"http://gsb.qifu.gongsibao.com/tlpay/notify"
;
}
},
qifubaoUrl
:
function
()
{
//企服宝(交付系统)
if
(
this
.
env
==
"dev"
)
{
return
"http://xxxx:xxxx/"
;
}
else
{
return
""
;
}
},
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://p.apps.com:4001/"
;
}
else
{
return
"https://open.gongsibao.com/"
;
}
},
centerAppUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerapp.apps.com:4010/"
;
}
else
{
return
"http://center-app-service/"
;
}
},
centerTmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerTmtransactioon.apps.com:4006/"
;
}
else
{
return
"http://center-tmtransaction-service/"
;
}
},
zzzdUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://106.13.228.212:80"
;
}
else
{
return
"http://qualitydoctor-service/"
;
}
},
// 2020 0807 lin 新增 营业执照识别请求地址
// 2020 0813 lin 修改 增加王昆给的正式环境地址
businessDistinguishUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://43.247.184.92:15504/"
}
else
{
return
"http://172.17.149.71:32505/"
}
},
// 2020 0810 lin 新增 四要素验证请求地址
fourFactorsUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://39.107.234.14:8026/bpo-sign/"
;
}
else
{
// 正式环境没给
}
},
centerChannelUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:4012/"
}
else
{
// return "channel的正式环境" 6.30修改目前只用作生成alipay/wx的通知回调地址
return
"http://youke.qifu.gongsibao.com/"
}
},
gatewayUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://localhost:4005/"
;
}
else
{
return
"https://channelgateway-api.gongsibao.com/"
;
}
},
centerOrderUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerorder.apps.com:4011/"
;
}
else
{
return
"http://center-order-service/"
;
}
},
igirlWeburl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://127.0.0.1:3000/"
;
}
else
{
return
"http://igirl-service/"
;
}
},
centerCacheUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://123.57.217.203:30005/"
;
}
else
{
return
"http://specialprofile-service/"
}
},
fileDealUrl
:
function
()
{
if
(
this
.
env
==
'dev'
)
{
return
"http://43.247.184.92:15503"
;
}
else
{
return
"http://43.247.184.92:15503"
}
},
reqTransferurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.61:3003/"
;
}
else
{
return
"http://jiaxiya-service/"
;
}
},
reqEsAddr
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
"http://43.247.184.94:7200/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://43.247.184.94:7200/"
;
}
},
certificationUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://43.247.184.92:15506/"
;
//
}
else
{
return
"http://43.247.184.92:15506/"
;
}
},
reqZcApi
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://zcapi.apps.com:4002/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://zcapi-service/"
;
//k8s服务名称
}
},
pushFqbossDataUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.141:3000/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"https://fqgirl.gongsibao.com/"
;
}
},
fqbossTmUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://fqgirlstage.gongsibao.com/api/tmsub/channelTmNotify"
}
else
{
return
"https://fqgirl.gongsibao.com/api/tmsub/channelTmNotify"
}
},
ucommuneUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://m-dev.ucommune.com/"
// 优客测试环境
}
else
{
// return "https://m.ucommune.com/"// 优客正式环境
return
"https://m.ucommune.com/"
// 6.29lin修改为测试环境。原因优客 目前还没有正式环境
}
},
tokenUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://oauth2.e.360.cn/site/token"
// 360测试环境
}
else
{
return
"https://oauth2.e.360.cn/site/token"
//
}
},
requestUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38085/"
// 360测试环境
}
else
{
return
"https://console.e.360.cn/"
//
}
},
pushUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38086/"
// 360测试环境
}
else
{
return
"https://tobadmin.e.360.cn/"
//
}
},
aliUappId
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
18
// uapp_id
}
else
{
return
18
// uapp_id
}
},
icNameUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"https://fqdev.gongsibao.com/"
}
else
{
return
"https://fq.gongsibao.com/"
}
},
openPlatformAK
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
{
"accessKey"
:
"111"
,
"accessSecret"
:
"222"
}
}
else
{
return
{
"accessKey"
:
"202101121716"
,
"accessSecret"
:
"12bb846776874167b5c7e01cd0116c12"
}
}
},
apiconfig
:
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"center_channel_log/_doc?pretty"
;
},
};
}
},
alipay
:
function
()
{
// 没有在使用 确定不需要后会去掉
return
new
AlipaySdk
({
opLogEsIsAdd
:
function
()
{
return
1
;
},
},
homePage
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
reqHomePageDevUrl
;
}
else
{
return
"http://boss.gongsibao.com/"
;
}
},
redis
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
redis
;
}
else
{
return
{
host
:
ENVINPUT
.
REDIS_HOST
,
port
:
ENVINPUT
.
REDIS_PORT
,
password
:
ENVINPUT
.
REDIS_PWD
,
db
:
ENVINPUT
.
REDIS_DB
,
};
}
},
database
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
return
localsettings
.
database
;
}
else
{
return
{
dbname
:
ENVINPUT
.
DB_NAME
,
user
:
ENVINPUT
.
DB_USER
,
password
:
ENVINPUT
.
DB_PWD
,
config
:
{
host
:
ENVINPUT
.
DB_HOST
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
max
:
5
,
min
:
0
,
acquire
:
90000000
,
idle
:
1000000
},
debug
:
false
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
},
};
}
},
alipay
:
function
()
{
// 没有在使用 确定不需要后会去掉
return
new
AlipaySdk
({
// appId: payConfig.ali.appId,
// appId: payConfig.ali.appId,
// privateKey: payConfig.ali.privateKey,
// privateKey: payConfig.ali.privateKey,
// alipayPublicKey: payConfig.ali.publicKey,
// alipayPublicKey: payConfig.ali.publicKey,
});
},
wxpay
:
function
()
{
// 没有在使用 确定不需要后会去掉
return
WXPay
({
appid
:
'wx6f3ebe44defe336a'
,
mch_id
:
'1232813602'
,
partner_key
:
'sinotone2014sinotone2014sinotone'
,
//微信商户平台API密钥
//pfx: fs.readFileSync('./wxpay_cert.p12'), //微信商户平台证书
//pfx: "sinotone2014sinotone2014sinotone"
})
// const config = {
// appid: 'wx6f3ebe44defe336a',
// mchid: '1232813602',
// partnerKey: 'sinotone2014sinotone2014sinotone',
// };
// return new tenpay(config);
},
paySecret
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
// return "ab53dfb909e4c32a";
return
"34cdecaac35b1d8d"
// 7.1之前测试环境的secret无法使用,测试/正式全部使用同一个secret
}
else
{
return
"34cdecaac35b1d8d"
;
// 6.29lin新增 小黑给的secret
}
},
ucommuneOperatorPhone
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"13911391996"
// 7.7修改测试环境优客 辅助/担保订单推送业务员手机号
}
else
{
return
"15754717260"
;
// 7.7修改正式环境优客 辅助/担保订单推送业务员手机号 刘文悦
}
},
pannongServiceConfig
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
{
appid
:
"10015683988"
,
appkey
:
"b74b73acf78cc2851aa559e93c84f7888adq23we"
}
}
else
{
// 2020 1106 lin 正式环境还未给出
// 2020 1119 lin 正式环境已经给出,鲁班说不变 后期可能换成动态的
return
{
appid
:
"10015683988"
,
appkey
:
"b74b73acf78cc2851aa559e93c84f7888adq23we"
}
}
},
pannongUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://39.101.172.142:8980/"
}
else
{
// 2020 1106 lin 正式环境还未给出
// 2020 1119 lin 正式环境已经给出,鲁班发的ip
return
"http://139.196.159.202:8980/"
});
},
wxpay
:
function
()
{
// 没有在使用 确定不需要后会去掉
return
WXPay
({
appid
:
'wx6f3ebe44defe336a'
,
mch_id
:
'1232813602'
,
partner_key
:
'sinotone2014sinotone2014sinotone'
,
//微信商户平台API密钥
//pfx: fs.readFileSync('./wxpay_cert.p12'), //微信商户平台证书
//pfx: "sinotone2014sinotone2014sinotone"
})
// const config = {
// appid: 'wx6f3ebe44defe336a',
// mchid: '1232813602',
// partnerKey: 'sinotone2014sinotone2014sinotone',
// };
// return new tenpay(config);
},
paySecret
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
// return "ab53dfb909e4c32a";
return
"34cdecaac35b1d8d"
// 7.1之前测试环境的secret无法使用,测试/正式全部使用同一个secret
}
else
{
return
"34cdecaac35b1d8d"
;
// 6.29lin新增 小黑给的secret
}
},
ucommuneOperatorPhone
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"13911391996"
// 7.7修改测试环境优客 辅助/担保订单推送业务员手机号
}
else
{
return
"15754717260"
;
// 7.7修改正式环境优客 辅助/担保订单推送业务员手机号 刘文悦
}
},
pannongServiceConfig
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
{
appid
:
"10015683988"
,
appkey
:
"b74b73acf78cc2851aa559e93c84f7888adq23we"
}
}
else
{
// 2020 1106 lin 正式环境还未给出
// 2020 1119 lin 正式环境已经给出,鲁班说不变 后期可能换成动态的
return
{
appid
:
"10015683988"
,
appkey
:
"b74b73acf78cc2851aa559e93c84f7888adq23we"
}
}
},
pannongUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://39.101.172.142:8980/"
}
else
{
// 2020 1106 lin 正式环境还未给出
// 2020 1119 lin 正式环境已经给出,鲁班发的ip
return
"http://139.196.159.202:8980/"
}
},
areaConfig
:
{
"1"
:
"北京"
,
"2"
:
"上海"
,
"3"
:
"福建"
,
"4"
:
"广西"
,
"5"
:
"广东"
,
"6"
:
"安徽"
,
"7"
:
"河南"
,
"8"
:
"湖北"
,
"9"
:
"浙江"
,
"10"
:
"江苏"
,
"11"
:
"山东"
,
"12"
:
"陕西"
,
"13"
:
"宁夏"
,
"14"
:
"甘肃"
,
"15"
:
"新疆"
,
"16"
:
"青海"
,
"17"
:
"天津"
,
"18"
:
"重庆"
,
"19"
:
"河北"
,
"20"
:
"山西"
,
"21"
:
"辽宁"
,
"22"
:
"吉林"
,
"23"
:
"黑龙江"
,
"24"
:
"江西"
,
"25"
:
"湖南"
,
"26"
:
"四川"
,
"27"
:
"贵州"
,
"28"
:
"云南"
,
"29"
:
"内蒙古"
,
"30"
:
"西藏"
,
"31"
:
"含外资"
,
"32"
:
"全外资"
,
"33"
:
"香港"
,
"34"
:
"海南"
,
"35"
:
"杭州"
,
"BEIJING"
:
"北京"
,
"SHANGHAI"
:
"上海"
,
"FUJIAN"
:
"福建"
,
"GUANGXI"
:
"广西"
,
"GUANGDONG"
:
"广东"
,
"ANHUI"
:
"安徽"
,
"HENAN"
:
"河南"
,
"HEBEI"
:
"河北"
,
"ZHEJIANG"
:
"浙江"
,
"JIANGSU"
:
"江苏"
,
"SHANDONG"
:
"山东"
,
"SHANGXI_SHAN"
:
"陕西"
,
"NINGXIA"
:
"宁夏"
,
"GANSU"
:
"甘肃"
,
"XINJIANG"
:
"新疆"
,
"QINGHAI"
:
"青海"
,
"TIANJIN"
:
"天津"
,
"CHONGQING"
:
"重庆"
,
"SHANXI_JIN"
:
"山西"
,
"LIAONING"
:
"辽宁"
,
"JINLIN"
:
"吉林"
,
"HEILONGJIANG"
:
"黑龙江"
,
"JIANGXI"
:
"江西"
,
"HUNAN"
:
"湖南"
,
"SICHUAN"
:
"四川"
,
"GUIZHOU"
:
"贵州"
,
"YUNNAN"
:
"云南"
,
"NEIMENGGU"
:
"内蒙古"
,
"XIZANG"
:
"西藏"
,
"WAIZI"
:
"外资"
,
"HAINAN"
:
"海南"
,
"SHENZHEN"
:
"深圳"
,
"GUANGZHOU"
:
"广州"
,
"HUBEI"
:
"湖北"
,
"HANGZHOU"
:
"杭州"
,
"QUANGUO"
:
"全国"
,
"HANWAIZI"
:
"含外资"
,
"QUANWAIZI"
:
"全外资"
,
"XIANGGANG"
:
"香港"
}
}
};
module
.
exports
=
settings
;
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