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
e3fe1a74
Commit
e3fe1a74
authored
Mar 25, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加京东再次推送
parent
ee6d2a0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
739 additions
and
717 deletions
+739
-717
igirl-channel-web/.gitignore
+2
-0
igirl-channel-web/app/base/controller/impl/trademark/tmqueryCtl.js
+737
-717
No files found.
igirl-channel-web/.gitignore
View file @
e3fe1a74
node_modules/
node_modules/
logs/
logs/
.idea
\ No newline at end of file
igirl-channel-web/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
e3fe1a74
...
@@ -2,752 +2,772 @@ var system = require("../../../system");
...
@@ -2,752 +2,772 @@ var system = require("../../../system");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
md5
=
require
(
"MD5"
);
const
md5
=
require
(
"MD5"
);
class
tmqueryCtl
extends
CtlBase
{
class
tmqueryCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
appInfo
=
{
this
.
appInfo
=
{
jd
:
{
appkey
:
"201911251551"
,
secret
:
"56006077354d48858026c80c0e10bef6"
},
jd
:
{
appkey
:
"201911251551"
,
secret
:
"56006077354d48858026c80c0e10bef6"
},
1688
:
{
appkey
:
"201911131657"
,
secret
:
"eeb18393aade40149287b024d8ba0850"
},
1688
:
{
appkey
:
"201911131657"
,
secret
:
"eeb18393aade40149287b024d8ba0850"
},
gsbhome
:
{
appkey
:
"201912141625"
,
secret
:
"8cbb846776874167b5c7e01cd0116c66"
},
gsbhome
:
{
appkey
:
"201912141625"
,
secret
:
"8cbb846776874167b5c7e01cd0116c66"
},
bw
:
{
appkey
:
"202001081738"
,
secret
:
"9bdcbc48afd04d9ba54236947a78210b"
},
bw
:
{
appkey
:
"202001081738"
,
secret
:
"9bdcbc48afd04d9ba54236947a78210b"
},
};
};
}
async
doPost
(
pobj
,
obj
,
req
)
{
if
([
"getOrderDeliveryInfo"
,
"getOrderInfo"
,
"subOtherOrder"
,
"subTmOrder"
,
"getTmOrderList"
,
"getTmOrderInfo"
,
"getTmApplyInfo"
,
"getTmNclList"
,
"getNeedInfo"
,
"tmConfirm"
,
"updateTmInfo"
,
"updateNclInfo"
,
"updateContacts"
,
"updateCustomerInfo"
].
indexOf
(
pobj
.
actionType
)
>=
0
)
{
if
(
!
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResultFail
(
-
99
,
"verify channelUserId is not empty"
);
}
if
(
!
req
.
session
.
userPinInfo
)
{
return
system
.
getResultFail
(
-
99
,
"user is not login"
);
}
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
!=
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResultFail
(
-
99
,
"user login is error"
);
}
pobj
.
isDecryptUser
=
"yes"
;
}
}
var
rc
=
system
.
getObject
(
"util.execClient"
);
try
{
async
doPost
(
pobj
,
obj
,
req
)
{
if
(
!
pobj
.
requrl
)
{
if
([
"getOrderDeliveryInfo"
,
"getOrderInfo"
,
"subOtherOrder"
,
"subTmOrder"
,
"getTmOrderList"
,
"getTmOrderInfo"
,
"getTmApplyInfo"
,
"getTmNclList"
,
return
system
.
getResult
(
null
,
"requrl不能为空"
);
"getNeedInfo"
,
"tmConfirm"
,
"updateTmInfo"
,
"updateNclInfo"
,
}
"updateContacts"
,
"updateCustomerInfo"
].
indexOf
(
pobj
.
actionType
)
>=
0
)
{
if
(
!
pobj
.
actionProcess
)
{
if
(
!
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResult
(
null
,
"actionProcess不能为空"
);
return
system
.
getResultFail
(
-
99
,
"verify channelUserId is not empty"
);
}
}
if
(
!
pobj
.
actionType
)
{
if
(
!
req
.
session
.
userPinInfo
)
{
return
system
.
getResult
(
null
,
"actionType不能为空"
);
return
system
.
getResultFail
(
-
99
,
"user is not login"
);
}
}
if
(
!
pobj
.
actionBody
)
{
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
!=
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResult
(
null
,
"actionBody不能为空"
);
return
system
.
getResultFail
(
-
99
,
"user login is error"
);
}
}
if
(
pobj
.
requrl
&&
pobj
.
requrl
.
indexOf
(
'|'
)
>=
0
)
{
pobj
.
isDecryptUser
=
"yes"
;
return
system
.
getResult
(
null
,
"非法请求!"
);
}
var
tmpReqUrl
=
pobj
.
requrl
.
replace
(
'|'
,
''
).
replace
(
' '
,
''
);
if
(
tmpReqUrl
.
length
!=
pobj
.
requrl
.
length
)
{
return
system
.
getResult
(
null
,
"非法请求!!"
);
}
var
reqobj
=
{
"actionProcess"
:
pobj
.
actionProcess
||
""
,
"actionType"
:
pobj
.
actionType
||
""
,
"sign"
:
pobj
.
sign
||
""
,
"isUser"
:
pobj
.
isUser
||
"yes"
,
//是否需要验证用户,no否,yes是
"isDecryptUser"
:
pobj
.
isDecryptUser
||
"no"
,
//是否解密用户Id,no否,yes是
"actionBody"
:
pobj
.
actionBody
||
null
};
var
tokenInfo
=
await
this
.
getToken
(
reqobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
if
(
!
pobj
.
timeStamp
)
{
let
currentDate
=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
reqobj
.
actionBody
.
timeStamp
=
currentDate
;
}
var
oldActionType
=
reqobj
.
actionType
;
var
oldActionBody
=
reqobj
.
actionBody
;
var
oldIsUser
=
reqobj
.
isUser
;
if
(
reqobj
.
isDecryptUser
==
"yes"
)
{
reqobj
.
actionType
=
"decryptStr"
;
reqobj
.
isUser
=
"no"
;
let
currentDate
=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
reqobj
.
actionBody
=
{
opStr
:
decodeURIComponent
(
oldActionBody
.
channelUserId
),
timeStamp
:
currentDate
};
var
decryptSignResult
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
if
(
decryptSignResult
.
status
!=
0
)
{
return
decryptSignResult
;
}
reqobj
.
sign
=
decryptSignResult
.
data
;
var
decrypReqUrl
=
this
.
channelApiUrl
+
pobj
.
requrl
;
var
decryptResult
=
await
this
.
execClient
.
execPostTK
(
reqobj
,
decrypReqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
decryptResult
)
{
return
system
.
getResult
(
null
,
"处理decryptStr请求失败"
);
}
}
if
(
decryptResult
.
status
&&
decryptResult
.
status
!=
0
)
{
var
rc
=
system
.
getObject
(
"util.execClient"
);
return
decryptResult
;
try
{
if
(
!
pobj
.
requrl
)
{
return
system
.
getResult
(
null
,
"requrl不能为空"
);
}
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess不能为空"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType不能为空"
);
}
if
(
!
pobj
.
actionBody
)
{
return
system
.
getResult
(
null
,
"actionBody不能为空"
);
}
if
(
pobj
.
requrl
&&
pobj
.
requrl
.
indexOf
(
'|'
)
>=
0
)
{
return
system
.
getResult
(
null
,
"非法请求!"
);
}
var
tmpReqUrl
=
pobj
.
requrl
.
replace
(
'|'
,
''
).
replace
(
' '
,
''
);
if
(
tmpReqUrl
.
length
!=
pobj
.
requrl
.
length
)
{
return
system
.
getResult
(
null
,
"非法请求!!"
);
}
var
reqobj
=
{
"actionProcess"
:
pobj
.
actionProcess
||
""
,
"actionType"
:
pobj
.
actionType
||
""
,
"sign"
:
pobj
.
sign
||
""
,
"isUser"
:
pobj
.
isUser
||
"yes"
,
//是否需要验证用户,no否,yes是
"isDecryptUser"
:
pobj
.
isDecryptUser
||
"no"
,
//是否解密用户Id,no否,yes是
"actionBody"
:
pobj
.
actionBody
||
null
};
var
tokenInfo
=
await
this
.
getToken
(
reqobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
if
(
!
pobj
.
timeStamp
)
{
let
currentDate
=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
reqobj
.
actionBody
.
timeStamp
=
currentDate
;
}
var
oldActionType
=
reqobj
.
actionType
;
var
oldActionBody
=
reqobj
.
actionBody
;
var
oldIsUser
=
reqobj
.
isUser
;
if
(
reqobj
.
isDecryptUser
==
"yes"
)
{
reqobj
.
actionType
=
"decryptStr"
;
reqobj
.
isUser
=
"no"
;
let
currentDate
=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
reqobj
.
actionBody
=
{
opStr
:
decodeURIComponent
(
oldActionBody
.
channelUserId
),
timeStamp
:
currentDate
};
var
decryptSignResult
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
if
(
decryptSignResult
.
status
!=
0
)
{
return
decryptSignResult
;
}
reqobj
.
sign
=
decryptSignResult
.
data
;
var
decrypReqUrl
=
this
.
channelApiUrl
+
pobj
.
requrl
;
var
decryptResult
=
await
this
.
execClient
.
execPostTK
(
reqobj
,
decrypReqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
decryptResult
)
{
return
system
.
getResult
(
null
,
"处理decryptStr请求失败"
);
}
if
(
decryptResult
.
status
&&
decryptResult
.
status
!=
0
)
{
return
decryptResult
;
}
if
(
!
decryptResult
.
data
||
decryptResult
.
data
==
""
)
{
decryptResult
.
status
=
-
201
;
decryptResult
.
msg
=
"decrypt channelUserId error"
;
return
decryptResult
;
}
if
(
oldActionBody
.
channelUserId
)
{
oldActionBody
.
channelUserId
=
decryptResult
.
data
;
}
if
(
oldActionBody
.
channelUser
&&
oldActionBody
.
channelUser
.
channelUserId
)
{
oldActionBody
.
channelUser
.
channelUserId
=
decryptResult
.
data
;
}
reqobj
.
actionType
=
oldActionType
;
reqobj
.
actionBody
=
oldActionBody
;
reqobj
.
isUser
=
oldIsUser
;
var
signResult
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
if
(
signResult
.
status
!=
0
)
{
return
signResult
;
}
reqobj
.
sign
=
signResult
.
data
;
}
//解密操作
if
(
!
reqobj
.
sign
)
{
var
signInfo
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
if
(
signInfo
.
status
!=
0
)
{
return
signInfo
;
}
reqobj
.
sign
=
signInfo
.
data
;
}
var
reqUrl
=
this
.
channelApiUrl
+
pobj
.
requrl
;
var
result
=
await
this
.
execClient
.
execPostTK
(
reqobj
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
result
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
if
([
"jd"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opJdPayPageInfoResult
=
await
this
.
opJdPayPageInfo
(
pobj
,
result
,
req
);
return
opJdPayPageInfoResult
;
}
else
if
([
"gsbhome"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opGsbPayPageInfoResult
=
await
this
.
opGsbPayPageInfo
(
pobj
,
result
,
req
);
return
opGsbPayPageInfoResult
;
}
if
([
"userPinByLgoin"
,
"userPinByLgoinVcode"
,
"userPinByRegister"
].
indexOf
(
pobj
.
actionType
)
>=
0
)
{
req
.
session
.
userPinInfo
=
{
encryptChannelUserId
:
result
.
data
.
channelUserId
,
userpin
:
result
.
data
.
userpin
,
userName
:
result
.
data
.
userName
,
isAdmin
:
result
.
data
.
isAdmin
||
0
};
}
//login
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"操作error..................."
);
return
system
.
getResult
(
null
,
"操作失败"
);
}
}
if
(
!
decryptResult
.
data
||
decryptResult
.
data
==
""
)
{
}
decryptResult
.
status
=
-
201
;
decryptResult
.
msg
=
"decrypt channelUserId error"
;
async
getToken
(
reqType
)
{
return
decryptResult
;
var
self
=
this
;
var
token
=
""
;
var
reqTokenUrl
=
this
.
channelApiUrl
+
"/auth/accessAuth/getToken"
;
var
reqParam
=
{};
switch
(
reqType
)
{
case
"jd"
:
reqParam
=
self
.
appInfo
[
"jd"
];
break
;
case
"1688"
:
reqParam
=
self
.
appInfo
[
"1688"
];
break
;
case
"gsbhome"
:
reqParam
=
self
.
appInfo
[
"gsbhome"
];
break
;
case
"bw"
:
reqParam
=
self
.
appInfo
[
"bw"
];
break
;
default
:
break
;
}
}
if
(
oldActionBody
.
channelUserId
)
{
if
(
!
reqParam
.
appkey
||
!
reqParam
.
secret
)
{
oldActionBody
.
channelUserId
=
decryptResult
.
data
;
return
system
.
getResult
(
null
,
"reqType类型有误,请求失败"
)
;
}
}
if
(
oldActionBody
.
channelUser
&&
oldActionBody
.
channelUser
.
channelUserId
)
{
var
rtn
=
await
this
.
execClient
.
execPost
(
reqParam
,
reqTokenUrl
);
oldActionBody
.
channelUser
.
channelUserId
=
decryptResult
.
data
;
if
(
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"获取token失败"
);
}
}
reqobj
.
actionType
=
oldActionType
;
var
tokenResult
=
JSON
.
parse
(
rtn
.
stdout
);
reqobj
.
actionBody
=
oldActionBody
;
if
(
tokenResult
.
status
==
0
)
{
reqobj
.
isUser
=
oldIsUser
;
tokenResult
.
data
.
secret
=
reqParam
.
secret
;
var
signResult
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
if
(
signResult
.
status
!=
0
)
{
return
signResult
;
}
}
re
qobj
.
sign
=
signResult
.
data
;
re
turn
tokenResult
;
}
//解密操作
}
if
(
!
reqobj
.
sign
)
{
/**
var
signInfo
=
await
this
.
createSign
(
reqobj
.
actionBody
,
tokenInfo
.
data
.
secret
);
* 验证签名
if
(
signInfo
.
status
!=
0
)
{
* @param {*} params 要验证的参数
return
signInfo
;
* @param {*} app_key 应用的校验key
* @param {*} isEmptySign params key 对应值为空是否参与签名
*/
async
createSign
(
params
,
app_key
,
isEmptySign
)
{
if
(
!
params
)
{
return
system
.
getResult
(
null
,
"请求参数为空"
);
}
}
reqobj
.
sign
=
signInfo
.
data
;
var
signArr
=
[];
}
var
keys
=
Object
.
keys
(
params
).
sort
();
var
reqUrl
=
this
.
channelApiUrl
+
pobj
.
requrl
;
if
(
keys
.
length
==
0
)
{
var
result
=
await
this
.
execClient
.
execPostTK
(
reqobj
,
reqUrl
,
tokenInfo
.
data
.
token
);
return
system
.
getResult
(
null
,
"请求参数信息为空"
);
if
(
!
result
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
if
([
"jd"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opJdPayPageInfoResult
=
await
this
.
opJdPayPageInfo
(
pobj
,
result
,
req
);
return
opJdPayPageInfoResult
;
}
else
if
([
"gsbhome"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opGsbPayPageInfoResult
=
await
this
.
opGsbPayPageInfo
(
pobj
,
result
,
req
);
return
opGsbPayPageInfoResult
;
}
if
([
"userPinByLgoin"
,
"userPinByLgoinVcode"
,
"userPinByRegister"
].
indexOf
(
pobj
.
actionType
)
>=
0
)
{
req
.
session
.
userPinInfo
=
{
encryptChannelUserId
:
result
.
data
.
channelUserId
,
userpin
:
result
.
data
.
userpin
,
userName
:
result
.
data
.
userName
,
isAdmin
:
result
.
data
.
isAdmin
||
0
};
}
//login
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"操作error..................."
);
return
system
.
getResult
(
null
,
"操作失败"
);
}
}
async
getToken
(
reqType
)
{
var
self
=
this
;
var
token
=
""
;
var
reqTokenUrl
=
this
.
channelApiUrl
+
"/auth/accessAuth/getToken"
;
var
reqParam
=
{};
switch
(
reqType
)
{
case
"jd"
:
reqParam
=
self
.
appInfo
[
"jd"
];
break
;
case
"1688"
:
reqParam
=
self
.
appInfo
[
"1688"
];
break
;
case
"gsbhome"
:
reqParam
=
self
.
appInfo
[
"gsbhome"
];
break
;
case
"bw"
:
reqParam
=
self
.
appInfo
[
"bw"
];
break
;
default
:
break
;
}
if
(
!
reqParam
.
appkey
||
!
reqParam
.
secret
)
{
return
system
.
getResult
(
null
,
"reqType类型有误,请求失败"
);
}
var
rtn
=
await
this
.
execClient
.
execPost
(
reqParam
,
reqTokenUrl
);
if
(
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"获取token失败"
);
}
var
tokenResult
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
tokenResult
.
status
==
0
)
{
tokenResult
.
data
.
secret
=
reqParam
.
secret
;
}
return
tokenResult
;
}
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
* @param {*} isEmptySign params key 对应值为空是否参与签名
*/
async
createSign
(
params
,
app_key
,
isEmptySign
)
{
if
(
!
params
)
{
return
system
.
getResult
(
null
,
"请求参数为空"
);
}
var
signArr
=
[];
var
keys
=
Object
.
keys
(
params
).
sort
();
if
(
keys
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请求参数信息为空"
);
}
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
const
tKey
=
keys
[
k
];
if
(
tKey
!=
"sign"
)
{
if
(
tKey
!=
"token"
)
{
if
(
tKey
!=
"actionProcess"
)
{
if
(
isEmptySign
)
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
}
else
{
if
(
params
[
tKey
])
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
}
}
}
}
}
}
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
}
const
tKey
=
keys
[
k
];
if
(
signArr
.
length
==
0
)
{
if
(
tKey
!=
"sign"
)
{
return
system
.
getResult
(
null
,
"请求参数组装签名参数信息为空"
);
if
(
tKey
!=
"token"
)
{
}
if
(
tKey
!=
"actionProcess"
)
{
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_key
;
if
(
isEmptySign
)
{
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
(
);
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]
);
return
system
.
getResultSuccess
(
resultTmpSign
);
}
else
{
}
if
(
params
[
tKey
])
{
async
getUserIdEncryptStr
(
pobj
,
qobj
,
req
)
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
try
{
}
if
(
!
req
.
session
.
userPinInfo
)
{
}
var
userInfo
=
await
this
.
createUserInfo
(
pobj
,
qobj
,
req
);
}
if
(
userInfo
.
status
!=
0
)
{
}
return
system
.
getResult
(
null
,
"user is not login..."
);
}
}
}
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
if
(
signArr
.
length
==
0
)
{
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
}
);
return
system
.
getResult
(
null
,
"请求参数组装签名参数信息为空"
);
}
}
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
app_key
;
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
});
return
system
.
getResultSuccess
(
resultTmpSign
);
}
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
pobj
.
actionProcess
,
actionType
:
"encryptStr"
,
actionBody
:
{
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
opStr
:
req
.
session
.
userPinInfo
.
channelUserId
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"encryptStr resultUser is empty"
);
}
if
(
resultUser
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"encryptStr resultUser is error"
);
}
req
.
session
.
userPinInfo
.
encryptChannelUserId
=
resultUser
.
data
||
""
;
return
system
.
getResultSuccess
({
encryptChannelUserId
:
resultUser
.
data
||
""
});
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error...................getUserIdEncryptStr"
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
async
createUserInfo
(
pobj
,
qobj
,
req
)
{
async
getUserIdEncryptStr
(
pobj
,
qobj
,
req
)
{
try
{
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
!
req
.
session
.
userPinInfo
)
{
if
(
tokenInfo
.
status
!=
0
)
{
var
userInfo
=
await
this
.
createUserInfo
(
pobj
,
qobj
,
req
);
return
tokenInfo
;
if
(
userInfo
.
status
!=
0
)
{
}
return
system
.
getResult
(
null
,
"user is not login..."
);
//有返回用户信息进行用户ID加密
}
var
param
=
{
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
actionProcess
:
pobj
.
actionProcess
,
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
});
actionType
:
"createChannelUser"
,
}
actionBody
:
{
channelUserId
:
pobj
.
channelUserId
,
channelUserMoblie
:
pobj
.
channelUserMoblie
||
""
},
}
isUser
:
"yes"
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
};
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
});
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
}
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
!
resultUser
)
{
if
(
tokenInfo
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
return
tokenInfo
;
}
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
//有返回用户信息进行用户ID加密
return
resultUser
;
var
param
=
{
}
catch
(
error
)
{
actionProcess
:
pobj
.
actionProcess
,
console
.
log
(
error
.
stack
,
"操作error...................getUserInfoTest"
);
actionType
:
"encryptStr"
,
return
system
.
getResultFail
(
-
200
,
"操作error"
);
actionBody
:
{
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
opStr
:
req
.
session
.
userPinInfo
.
channelUserId
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"encryptStr resultUser is empty"
);
}
if
(
resultUser
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"encryptStr resultUser is error"
);
}
req
.
session
.
userPinInfo
.
encryptChannelUserId
=
resultUser
.
data
||
""
;
return
system
.
getResultSuccess
({
encryptChannelUserId
:
resultUser
.
data
||
""
});
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error...................getUserIdEncryptStr"
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
}
async
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
)
{
//关联下单的数据
async
createUserInfo
(
pobj
,
qobj
,
req
)
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
try
{
if
(
tokenInfo
.
status
!=
0
)
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
return
tokenInfo
;
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
pobj
.
actionProcess
,
actionType
:
"createChannelUser"
,
actionBody
:
{
channelUserId
:
pobj
.
channelUserId
,
channelUserMoblie
:
pobj
.
channelUserMoblie
||
""
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
return
resultUser
;
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error...................getUserInfoTest"
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
this
.
info
({
optitle
:
"###关联下单的数据参数"
,
async
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
)
{
//关联下单的数据
op
:
"putPayOrderData"
,
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
if
(
tokenInfo
.
status
!=
0
)
{
clientIp
:
""
return
tokenInfo
;
});
}
var
param
=
{
this
.
info
({
actionProcess
:
pobj
.
actionProcess
,
optitle
:
"###关联下单的数据参数"
,
actionType
:
"updateOrderStatus"
,
op
:
"putPayOrderData"
,
actionBody
:
{
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
clientIp
:
""
orderNo
:
orderResult
.
data
.
orderNo
,
});
needNo
:
needNo
,
var
param
=
{
needNoOrderNo
:
needNoOrderNo
actionProcess
:
pobj
.
actionProcess
,
},
actionType
:
"updateOrderStatus"
,
isUser
:
"yes"
actionBody
:
{
};
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
orderNo
:
orderResult
.
data
.
orderNo
,
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
needNo
:
needNo
,
var
tmp
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
needNoOrderNo
:
needNoOrderNo
this
.
info
({
},
optitle
:
"###关联下单的数据---结果"
,
isUser
:
"yes"
op
:
"putPayOrderData"
,
};
content
:
"结果="
+
JSON
.
stringify
(
tmp
),
clientIp
:
""
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
});
var
tmp
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
}
this
.
info
({
optitle
:
"###关联下单的数据---结果"
,
async
getOrderDetails
(
pobj
,
qobj
,
req
)
{
op
:
"putPayOrderData"
,
try
{
content
:
"结果="
+
JSON
.
stringify
(
tmp
),
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
clientIp
:
""
if
(
tokenInfo
.
status
!=
0
)
{
});
return
tokenInfo
;
}
var
param
=
{
actionProcess
:
pobj
.
actionProcess
,
actionType
:
"getOrderDetails"
,
actionBody
:
pobj
,
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
result
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
result
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
return
result
;
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error...................getOrderDetails"
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
//----------------------------jd------操作------------start
async
getOrderDetails
(
pobj
,
qobj
,
req
)
{
async
getJdUserInfo
(
pobj
,
qobj
,
req
)
{
try
{
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
req
.
session
.
userPinInfo
=
null
;
if
(
tokenInfo
.
status
!=
0
)
{
if
(
req
.
session
.
userPinInfo
)
{
return
tokenInfo
;
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
||
""
});
}
}
var
param
=
{
var
authUrl
=
pobj
.
authUrl
;
actionProcess
:
pobj
.
actionProcess
,
var
authToken
=
pobj
.
authToken
;
actionType
:
"getOrderDetails"
,
var
actionProcess
=
pobj
.
actionProcess
;
actionBody
:
pobj
,
if
(
!
authUrl
)
{
isUser
:
"yes"
return
system
.
getResult
(
null
,
"authUrl不能为空"
);
};
}
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
if
(
!
authToken
)
{
var
result
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
return
system
.
getResult
(
null
,
"authToken不能为空"
);
if
(
!
result
)
{
}
return
system
.
getResult
(
null
,
"处理请求失败"
);
if
(
!
actionProcess
)
{
}
return
system
.
getResult
(
null
,
"actionProcess不能为空"
);
return
result
;
}
}
catch
(
error
)
{
var
result
=
await
this
.
execClient
.
execPostJDTK
(
""
,
authUrl
,
authToken
);
console
.
log
(
error
.
stack
,
"操作error...................getOrderDetails"
);
if
(
!
result
||
!
result
.
account
)
{
return
system
.
getResultFail
(
-
200
,
"操作error"
);
return
system
.
getResult
(
null
,
"处理用户请求失败,msg:"
+
result
.
error_description
);
}
}
var
tokenInfo
=
await
this
.
getToken
(
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
actionProcess
,
actionType
:
"createChannelUser"
,
actionBody
:
{
channelUserId
:
result
.
account
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
this
.
info
({
optitle
:
"###获取京东用户结果"
,
op
:
"/jd/getJdUserInfo"
,
content
:
"param参数="
+
JSON
.
stringify
(
param
)
+
",resultUser="
+
JSON
.
stringify
(
resultUser
),
clientIp
:
""
});
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
return
system
.
getResultSuccess
({
encryptChannelUserId
:
resultUser
.
data
.
encryptChannelUserId
||
""
});
}
catch
(
error
)
{
this
.
error
({
optitle
:
"###获取京东用户异常"
,
op
:
"/jd/getJdUserInfo"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
async
opJdPayPageInfo
(
pobj
,
orderResult
,
req
)
{
//操作下单的数据跟渠道订单关联
//----------------------------jd------操作------------start
async
getJdUserInfo
(
pobj
,
qobj
,
req
)
{
this
.
info
({
try
{
optitle
:
"###操作下单的数据跟渠道订单关联参数"
,
req
.
session
.
userPinInfo
=
null
;
op
:
"/jd/opJdPayPageInfo"
,
if
(
req
.
session
.
userPinInfo
)
{
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
||
""
});
clientIp
:
""
}
});
var
authUrl
=
pobj
.
authUrl
;
var
authToken
=
pobj
.
authToken
;
if
(
!
pobj
.
actionBody
.
itemCode
)
{
var
actionProcess
=
pobj
.
actionProcess
;
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
if
(
!
authUrl
)
{
return
system
.
getResult
(
null
,
"authUrl不能为空"
);
}
if
(
!
authToken
)
{
return
system
.
getResult
(
null
,
"authToken不能为空"
);
}
if
(
!
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess不能为空"
);
}
var
result
=
await
this
.
execClient
.
execPostJDTK
(
""
,
authUrl
,
authToken
);
if
(
!
result
||
!
result
.
account
)
{
return
system
.
getResult
(
null
,
"处理用户请求失败,msg:"
+
result
.
error_description
);
}
var
tokenInfo
=
await
this
.
getToken
(
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
actionProcess
,
actionType
:
"createChannelUser"
,
actionBody
:
{
channelUserId
:
result
.
account
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
this
.
info
({
optitle
:
"###获取京东用户结果"
,
op
:
"/jd/getJdUserInfo"
,
content
:
"param参数="
+
JSON
.
stringify
(
param
)
+
",resultUser="
+
JSON
.
stringify
(
resultUser
),
clientIp
:
""
});
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
return
system
.
getResultSuccess
({
encryptChannelUserId
:
resultUser
.
data
.
encryptChannelUserId
||
""
});
}
catch
(
error
)
{
this
.
error
({
optitle
:
"###获取京东用户异常"
,
op
:
"/jd/getJdUserInfo"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
if
(
pobj
.
actionProcess
==
"jd"
)
{
var
itemCodeList
=
pobj
.
actionBody
.
itemCode
.
split
(
'-'
);
async
opJdPayPageInfo
(
pobj
,
orderResult
,
req
)
{
//操作下单的数据跟渠道订单关联
if
(
itemCodeList
.
length
<
2
)
{
return
system
.
getResult
(
null
,
"itemCode is error"
);
this
.
info
({
}
optitle
:
"###操作下单的数据跟渠道订单关联参数"
,
var
tmpResult
=
await
this
.
getJdPayPageAddr
(
pobj
.
actionBody
.
itemCode
,
itemCodeList
,
req
);
op
:
"/jd/opJdPayPageInfo"
,
// { result: true,
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
// data:
clientIp
:
""
// '{"success":true,"code":null,"msg":null,"data":{"orderNumber":"6058867","erpOrderId":"523198741458590844",
});
// "returnUrl":"https://buy.jdcloud.com/pay?orderId=523198741458590844","saasCheckUrl":null}}' }
if
(
!
pobj
.
actionBody
.
itemCode
)
{
this
.
info
({
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
optitle
:
"###操作下单的数据跟渠道订单关联--结果"
,
}
op
:
"/jd/opJdPayPageInfo"
,
if
(
pobj
.
actionProcess
==
"jd"
)
{
content
:
"tmpResult="
+
JSON
.
stringify
(
tmpResult
),
var
itemCodeList
=
pobj
.
actionBody
.
itemCode
.
split
(
'-'
);
clientIp
:
""
if
(
itemCodeList
.
length
<
2
)
{
});
return
system
.
getResult
(
null
,
"itemCode is error"
);
}
if
(
tmpResult
&&
tmpResult
.
result
&&
tmpResult
.
result
==
true
)
{
var
tmpResult
=
await
this
.
getJdPayPageAddr
(
pobj
.
actionBody
.
itemCode
,
itemCodeList
,
req
);
var
payDataResult
=
JSON
.
parse
(
tmpResult
.
data
);
// { result: true,
if
(
payDataResult
&&
payDataResult
.
success
&&
payDataResult
.
success
==
true
)
{
// data:
//更新订单信息
// '{"success":true,"code":null,"msg":null,"data":{"orderNumber":"6058867","erpOrderId":"523198741458590844",
var
needNo
=
pobj
.
actionBody
.
itemCode
+
"_"
+
payDataResult
.
data
.
orderNumber
;
// "returnUrl":"https://buy.jdcloud.com/pay?orderId=523198741458590844","saasCheckUrl":null}}' }
var
needNoOrderNo
=
payDataResult
.
data
.
orderNumber
;
await
this
.
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
);
this
.
info
({
return
system
.
getResultSuccess
({
payUrl
:
payDataResult
.
data
.
returnUrl
});
optitle
:
"###操作下单的数据跟渠道订单关联--结果"
,
}
//成功
op
:
"/jd/opJdPayPageInfo"
,
}
content
:
"tmpResult="
+
JSON
.
stringify
(
tmpResult
),
return
system
.
getResult
(
null
,
"pay page is error"
);
clientIp
:
""
});
if
(
tmpResult
&&
tmpResult
.
result
&&
tmpResult
.
result
==
true
)
{
var
payDataResult
=
JSON
.
parse
(
tmpResult
.
data
);
if
(
payDataResult
&&
payDataResult
.
success
&&
payDataResult
.
success
==
true
)
{
//更新订单信息
var
needNo
=
pobj
.
actionBody
.
itemCode
+
"_"
+
payDataResult
.
data
.
orderNumber
;
var
needNoOrderNo
=
payDataResult
.
data
.
orderNumber
;
await
this
.
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
);
return
system
.
getResultSuccess
({
payUrl
:
payDataResult
.
data
.
returnUrl
});
}
//成功
}
return
system
.
getResult
(
null
,
"pay page is error"
);
}
return
system
.
getResultSuccess
();
}
}
return
system
.
getResultSuccess
();
}
async
getJdPayPageAddr
(
itemCode
,
itemCodeList
,
req
)
{
//获取京东下单
try
{
async
getJdPayPageAddr
(
itemCode
,
itemCodeList
,
req
)
{
//获取京东下单
const
{
Signer
,
Context
}
=
require
(
'../jd-gateway-sdk'
);
try
{
let
ctx
=
new
Context
(
'x3k0s704lfun.cn-north-1.jdcloud-api.net'
,
'/market/order/api/submit'
,
'POST'
,
null
,
'empty'
);
const
{
Signer
,
Context
}
=
require
(
'../jd-gateway-sdk'
);
ctx
.
regionId
=
'cn-north-1'
let
ctx
=
new
Context
(
'x3k0s704lfun.cn-north-1.jdcloud-api.net'
,
'/market/order/api/submit'
,
'POST'
,
null
,
'empty'
);
ctx
.
headers
.
set
(
'content-type'
,
'application/json'
);
ctx
.
regionId
=
'cn-north-1'
ctx
.
headers
.
set
(
'content-type'
,
'application/json'
);
let
credentials
=
{
accessKeyId
:
'A46DC38C2435B0FFF8615B284B958A93'
,
//替换自己的AK
let
credentials
=
{
secretAccessKey
:
'0D661D3C4890563AE73B7AE50C6207A8'
//替换自己的SK--jd>>>>>>>
accessKeyId
:
'A46DC38C2435B0FFF8615B284B958A93'
,
//替换自己的AK
}
secretAccessKey
:
'0D661D3C4890563AE73B7AE50C6207A8'
//替换自己的SK--jd>>>>>>>
//测试报文:
}
//ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
//测试报文:
//POST
//ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
var
qs
=
require
(
'querystring'
);
//POST
// var post_data = {
var
qs
=
require
(
'querystring'
);
// pin: req.session.userPinInfo.channelUserId,
// var post_data = {
// serviceId: itemCodeList[1],
// pin: req.session.userPinInfo.channelUserId,
// itemCode: itemCode,
// serviceId: itemCodeList[1],
// platform: 6,
// itemCode: itemCode,
// orderNum: 1,
// platform: 6,
// articleType: 1,
// orderNum: 1,
// additions: '{ \"247\": 0 }'
// articleType: 1,
// };//这是需要提交的数据------有附加项
// additions: '{ \"247\": 0 }'
var
post_data
=
{
// };//这是需要提交的数据------有附加项
pin
:
req
.
session
.
userPinInfo
.
channelUserId
,
var
post_data
=
{
serviceId
:
itemCodeList
[
1
],
pin
:
req
.
session
.
userPinInfo
.
channelUserId
,
itemCode
:
itemCode
,
serviceId
:
itemCodeList
[
1
],
platform
:
6
,
itemCode
:
itemCode
,
orderNum
:
1
,
platform
:
6
,
articleType
:
1
orderNum
:
1
,
};
//这是需要提交的数据
articleType
:
1
};
//这是需要提交的数据
var
tmpContent
=
JSON
.
stringify
(
post_data
);
var
tmpContentLength
=
Buffer
.
byteLength
(
tmpContent
);
var
tmpContent
=
JSON
.
stringify
(
post_data
);
ctx
.
body
=
tmpContent
;
var
tmpContentLength
=
Buffer
.
byteLength
(
tmpContent
);
ctx
.
body
=
tmpContent
;
ctx
.
method
=
'POST'
var
signer
=
new
Signer
(
ctx
,
credentials
);
ctx
.
method
=
'POST'
ctx
.
headers
.
set
(
'Content-Length'
,
tmpContentLength
)
var
signer
=
new
Signer
(
ctx
,
credentials
);
ctx
.
buildNonce
()
ctx
.
headers
.
set
(
'Content-Length'
,
tmpContentLength
)
var
dd
=
new
Date
();
ctx
.
buildNonce
()
var
auth
=
signer
.
sign
(
dd
)
var
dd
=
new
Date
();
var
auth
=
signer
.
sign
(
dd
)
console
.
log
(
"POST签名为:"
,
auth
)
ctx
.
headers
.
set
(
'Authorization'
,
auth
)
console
.
log
(
"POST签名为:"
,
auth
)
ctx
.
headers
.
set
(
'Authorization'
,
auth
)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
var
http
=
require
(
'https'
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
var
http
=
require
(
'https'
);
var
options
=
{
host
:
'x3k0s704lfun.cn-north-1.jdcloud-api.net'
,
var
options
=
{
port
:
443
,
host
:
'x3k0s704lfun.cn-north-1.jdcloud-api.net'
,
path
:
'/market/order/api/submit'
,
port
:
443
,
method
:
'POST'
,
path
:
'/market/order/api/submit'
,
headers
:
{}
method
:
'POST'
,
};
headers
:
{
for
(
let
[
key
,
value
]
of
ctx
.
headers
)
{
options
.
headers
[
key
]
=
value
}
this
.
info
({
optitle
:
"###获取京东下单--参数"
,
op
:
"/jd/getJdPayPageAddr"
,
content
:
"options="
+
JSON
.
stringify
(
options
)
+
",tmpContent="
+
JSON
.
stringify
(
tmpContent
),
clientIp
:
""
});
var
reqResult
=
await
new
Promise
(
function
(
resolve
,
reject
)
{
let
req
=
http
.
request
(
options
,
function
(
res
)
{
// res.setEncoding(encoding);
console
.
log
(
"statusCode: "
,
res
.
statusCode
);
console
.
log
(
"headers: "
,
res
.
headers
);
var
_data
=
''
;
res
.
on
(
'data'
,
function
(
chunk
)
{
_data
+=
chunk
;
});
res
.
on
(
'end'
,
function
()
{
console
.
log
(
"
\
n--req---成功->>
\
nresult:"
,
_data
)
resolve
({
result
:
true
,
data
:
_data
});
});
});
req
.
on
(
'error'
,
(
e
)
=>
{
console
.
error
(
`请求遇到问题-------------:
${
e
.
message
}
`
);
resolve
({
result
:
false
,
errmsg
:
e
.
message
});
});
req
.
write
(
tmpContent
);
req
.
end
();
});
return
reqResult
;
}
catch
(
errorMsg
)
{
this
.
error
({
optitle
:
"###获取京东下单--异常"
,
op
:
"/jd/getJdPayPageAddr"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
{
success
:
false
,
code
:
-
200
,
msg
:
error
.
stack
};
}
}
};
for
(
let
[
key
,
value
]
of
ctx
.
headers
)
{
options
.
headers
[
key
]
=
value
}
this
.
info
({
optitle
:
"###获取京东下单--参数"
,
op
:
"/jd/getJdPayPageAddr"
,
content
:
"options="
+
JSON
.
stringify
(
options
)
+
",tmpContent="
+
JSON
.
stringify
(
tmpContent
),
clientIp
:
""
});
var
reqResult
=
await
new
Promise
(
function
(
resolve
,
reject
)
{
let
req
=
http
.
request
(
options
,
function
(
res
)
{
// res.setEncoding(encoding);
console
.
log
(
"statusCode: "
,
res
.
statusCode
);
console
.
log
(
"headers: "
,
res
.
headers
);
var
_data
=
''
;
res
.
on
(
'data'
,
function
(
chunk
)
{
_data
+=
chunk
;
});
res
.
on
(
'end'
,
function
()
{
console
.
log
(
"
\
n--req---成功->>
\
nresult:"
,
_data
)
resolve
({
result
:
true
,
data
:
_data
});
});
});
req
.
on
(
'error'
,
(
e
)
=>
{
console
.
error
(
`请求遇到问题-------------:
${
e
.
message
}
`
);
resolve
({
result
:
false
,
errmsg
:
e
.
message
});
});
req
.
write
(
tmpContent
);
req
.
end
();
});
return
reqResult
;
}
catch
(
errorMsg
)
{
this
.
error
({
optitle
:
"###获取京东下单--异常"
,
op
:
"/jd/getJdPayPageAddr"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
{
success
:
false
,
code
:
-
200
,
msg
:
error
.
stack
};
}
}
}
async
doPushJdPayOrderPost
(
pobj
,
obj
,
req
)
{
async
pushJdPayOrder
(
pushData
,
req
)
{
//处理京东推送的订单信息
if
(
pobj
.
actionType
!=
"pushJdPayOrder"
)
{
this
.
info
({
return
system
.
getResultFail
(
-
1
,
"actionType pushJdPayOrder"
);
optitle
:
"###处理京东推送的订单信息参数"
,
}
op
:
"/jd/pushJdPayOrder"
,
return
await
this
.
pushJdPayOrder
(
pobj
.
actionBody
,
req
)
content
:
"pushData参数="
+
JSON
.
stringify
(
pushData
),
clientIp
:
""
});
try
{
var
signResult
=
await
this
.
createSign
(
pushData
,
"F6FBD101C7571ADE231670F080653874"
,
true
);
if
(
signResult
.
status
!=
0
)
{
return
signResult
;
}
if
(
signResult
.
data
!=
pushData
.
token
.
toUpperCase
())
{
return
system
.
getResult
(
null
,
"签名错误"
);
}
var
tokenInfo
=
await
this
.
getToken
(
pushData
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//自助注册产品---用updateOrderPayStatus,否则为addOrderAndDelivery
var
param
=
{
actionProcess
:
pushData
.
actionProcess
,
actionType
:
""
,
actionBody
:
{
channelUserId
:
pushData
.
jdPin
,
payStatus
:
"yfk"
,
channelItemCode
:
pushData
.
skuId
,
//------用此字段查询渠道产品是否存在
needNo
:
pushData
.
skuId
+
"_"
+
pushData
.
orderNumber
,
needNoOrderNo
:
pushData
.
orderNumber
,
//---用此字段查找
buyerMoblie
:
pushData
.
mobile
,
payCode
:
pushData
.
skuId
,
email
:
pushData
.
email
},
isUser
:
"yes"
};
if
([
"FW_GOODS-582206-1"
,
"FW_GOODS-582208-1"
,
"FW_GOODS-582207-1"
].
indexOf
(
pushData
.
skuId
)
>=
0
)
{
param
.
actionType
=
pushData
.
skuId
==
"FW_GOODS-582206-1"
?
"updateOrderPayStatus"
:
"addOrderAndDelivery"
;
}
//商标的产品订单
else
{
param
.
actionBody
.
channelItemCode
=
pushData
.
serviceCode
;
param
.
actionType
=
"jdAddQifuOrder"
;
}
//工商产品订单
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
this
.
info
({
optitle
:
"###处理京东推送的订单信息结果"
,
op
:
"/jd/pushJdPayOrder"
,
content
:
"result="
+
JSON
.
stringify
(
resultUser
),
clientIp
:
""
});
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"req error"
);
}
return
resultUser
;
}
catch
(
error
)
{
this
.
error
({
optitle
:
"###处理京东推送的订单信息异常"
,
op
:
"/jd/pushJdPayOrder"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
//----------------------------jd------操作------------end
async
pushJdPayOrder
(
pushData
,
req
)
{
//处理京东推送的订单信息
this
.
info
({
//----------------------------gsb------操作------------start
optitle
:
"###处理京东推送的订单信息参数"
,
op
:
"/jd/pushJdPayOrder,reqUrl="
+
req
.
url
,
async
opGsbPayPageInfo
(
pobj
,
orderResult
,
req
)
{
//操作下单的数据跟渠道订单关联
content
:
"pushData参数="
+
JSON
.
stringify
(
pushData
),
this
.
info
({
clientIp
:
""
optitle
:
"###操作下单的数据跟渠道订单关联参数"
,
});
op
:
"/gsbhome/opGsbPayPageInfo"
,
try
{
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
var
signResult
=
await
this
.
createSign
(
pushData
,
"F6FBD101C7571ADE231670F080653874"
,
true
);
clientIp
:
""
if
(
signResult
.
status
!=
0
)
{
});
return
signResult
;
if
(
!
pobj
.
actionBody
.
itemCode
)
{
}
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
if
(
signResult
.
data
!=
pushData
.
token
.
toUpperCase
())
{
return
system
.
getResult
(
null
,
"签名错误"
);
}
var
tokenInfo
=
await
this
.
getToken
(
pushData
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//自助注册产品---用updateOrderPayStatus,否则为addOrderAndDelivery
var
param
=
{
actionProcess
:
pushData
.
actionProcess
,
actionType
:
""
,
actionBody
:
{
channelUserId
:
pushData
.
jdPin
,
payStatus
:
"yfk"
,
channelItemCode
:
pushData
.
skuId
,
//------用此字段查询渠道产品是否存在
needNo
:
pushData
.
skuId
+
"_"
+
pushData
.
orderNumber
,
needNoOrderNo
:
pushData
.
orderNumber
,
//---用此字段查找
buyerMoblie
:
pushData
.
mobile
,
payCode
:
pushData
.
skuId
,
email
:
pushData
.
email
},
isUser
:
"yes"
};
if
([
"FW_GOODS-582206-1"
,
"FW_GOODS-582208-1"
,
"FW_GOODS-582207-1"
].
indexOf
(
pushData
.
skuId
)
>=
0
)
{
param
.
actionType
=
pushData
.
skuId
==
"FW_GOODS-582206-1"
?
"updateOrderPayStatus"
:
"addOrderAndDelivery"
;
}
//商标的产品订单
else
{
param
.
actionBody
.
channelItemCode
=
pushData
.
serviceCode
;
param
.
actionType
=
"jdAddQifuOrder"
;
}
//工商产品订单
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
this
.
info
({
optitle
:
"###处理京东推送的订单信息结果"
,
op
:
"/jd/pushJdPayOrder"
,
content
:
"result="
+
JSON
.
stringify
(
resultUser
),
clientIp
:
""
});
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"req error"
);
}
return
resultUser
;
}
catch
(
error
)
{
this
.
error
({
optitle
:
"###处理京东推送的订单信息异常"
,
op
:
"/jd/pushJdPayOrder"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
//----------------------------jd------操作------------end
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
//----------------------------gsb------操作------------start
}
var
param
=
{
async
opGsbPayPageInfo
(
pobj
,
orderResult
,
req
)
{
//操作下单的数据跟渠道订单关联
actionProcess
:
pobj
.
actionProcess
,
this
.
info
({
actionType
:
"subGsbOrderInfo"
,
optitle
:
"###操作下单的数据跟渠道订单关联参数"
,
actionBody
:
{
op
:
"/gsbhome/opGsbPayPageInfo"
,
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
content
:
"pobj参数="
+
JSON
.
stringify
(
pobj
)
+
",orderResult="
+
JSON
.
stringify
(
orderResult
),
channelItemCode
:
pobj
.
actionBody
.
itemCode
,
clientIp
:
""
order_param
:
{
});
mobile_phone
:
req
.
session
.
userPinInfo
.
userMoblie
||
"18888888888"
,
//必填
if
(
!
pobj
.
actionBody
.
itemCode
)
{
goods_list
:
[{
//必填
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
goods_name
:
pobj
.
actionBody
.
itemCode
,
}
goods_quantity
:
1
,
try
{
}],
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
order_price
:
300
,
//必填
if
(
tokenInfo
.
status
!=
0
)
{
province_name
:
""
,
//省
return
tokenInfo
;
city_name
:
""
,
//市
}
district_name
:
""
//区
var
param
=
{
}
actionProcess
:
pobj
.
actionProcess
,
},
actionType
:
"subGsbOrderInfo"
,
isUser
:
"yes"
actionBody
:
{
};
channelUserId
:
req
.
session
.
userPinInfo
.
channelUserId
,
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
channelItemCode
:
pobj
.
actionBody
.
itemCode
,
this
.
info
({
order_param
:
{
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo"
,
mobile_phone
:
req
.
session
.
userPinInfo
.
userMoblie
||
"18888888888"
,
//必填
op
:
"/gsbhome/opGsbPayPageInfo"
,
goods_list
:
[{
//必填
content
:
"参数:"
+
JSON
.
stringify
(
param
),
goods_name
:
pobj
.
actionBody
.
itemCode
,
clientIp
:
""
goods_quantity
:
1
,
});
}],
var
payDataResult
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
order_price
:
300
,
//必填
this
.
info
({
province_name
:
""
,
//省
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo----结果"
,
city_name
:
""
,
//市
op
:
"/gsbhome/opGsbPayPageInfo"
,
district_name
:
""
//区
content
:
"结果:"
+
JSON
.
stringify
(
payDataResult
),
}
clientIp
:
""
},
});
isUser
:
"yes"
if
(
!
payDataResult
&&
payDataResult
.
status
!=
1
)
{
};
return
system
.
getResult
(
null
,
"req error"
);
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
}
this
.
info
({
//更新订单信息
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo"
,
var
needNo
=
"zzsbzc_"
+
payDataResult
.
data
.
order_no
;
op
:
"/gsbhome/opGsbPayPageInfo"
,
var
needNoOrderNo
=
payDataResult
.
data
.
order_no
;
content
:
"参数:"
+
JSON
.
stringify
(
param
),
await
this
.
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
);
clientIp
:
""
return
system
.
getResultSuccess
({
payUrl
:
payDataResult
.
data
.
order_detail_url
});
});
}
catch
(
error
)
{
var
payDataResult
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
console
.
log
(
"req---->opGsbPayPageInfo---->操作error:"
+
error
.
stack
);
this
.
info
({
this
.
error
({
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo----结果"
,
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo----异常"
,
op
:
"/gsbhome/opGsbPayPageInfo"
,
op
:
"/gsbhome/opGsbPayPageInfo"
,
content
:
"结果:"
+
JSON
.
stringify
(
payDataResult
),
content
:
"结果:"
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
clientIp
:
""
});
});
if
(
!
payDataResult
&&
payDataResult
.
status
!=
1
)
{
return
system
.
getResultFail
(
-
200
,
"操作error"
+
error
.
stack
);
return
system
.
getResult
(
null
,
"req error"
);
}
//更新订单信息
var
needNo
=
"zzsbzc_"
+
payDataResult
.
data
.
order_no
;
var
needNoOrderNo
=
payDataResult
.
data
.
order_no
;
await
this
.
putPayOrderData
(
pobj
,
orderResult
,
needNo
,
needNoOrderNo
,
req
);
return
system
.
getResultSuccess
({
payUrl
:
payDataResult
.
data
.
order_detail_url
});
}
catch
(
error
)
{
console
.
log
(
"req---->opGsbPayPageInfo---->操作error:"
+
error
.
stack
);
this
.
error
({
optitle
:
"###操作下单的数据跟渠道订单关联参数---请求subGsbOrderInfo----异常"
,
op
:
"/gsbhome/opGsbPayPageInfo"
,
content
:
"结果:"
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
});
return
system
.
getResultFail
(
-
200
,
"操作error"
+
error
.
stack
);
}
return
system
.
getResultSuccess
();
}
}
return
system
.
getResultSuccess
();
}
async
pushGsbPayOrder
(
pushData
,
req
)
{
//处理公司宝推送的订单信息
async
pushGsbPayOrder
(
pushData
,
req
)
{
//处理公司宝推送的订单信息
this
.
info
({
this
.
info
({
optitle
:
"###处理公司宝推送的订单信息参数"
,
optitle
:
"###处理公司宝推送的订单信息参数
"
,
op
:
"/gsbhome/pushGsbPayOrder
"
,
op
:
"/gsbhome/pushGsbPayOrder"
,
content
:
"pushData参数="
+
JSON
.
stringify
(
pushData
)
,
content
:
"pushData参数="
+
JSON
.
stringify
(
pushData
),
clientIp
:
""
clientIp
:
""
});
});
try
{
try
{
var
signResult
=
await
this
.
createSign
(
pushData
,
"a7bbb13627cd11ea98c800163e06da98"
,
true
);
var
signResult
=
await
this
.
createSign
(
pushData
,
"a7bbb13627cd11ea98c800163e06da98"
,
true
);
if
(
signResult
.
status
!=
0
)
{
if
(
signResult
.
status
!=
0
)
{
return
signResult
;
return
signResult
;
}
}
if
(
!
pushData
.
sign
)
{
if
(
!
pushData
.
sign
)
{
return
system
.
getResult
(
null
,
"sign is empty"
);
return
system
.
getResult
(
null
,
"sign is empty"
);
}
}
if
(
signResult
.
data
!=
pushData
.
sign
.
toUpperCase
())
{
if
(
signResult
.
data
!=
pushData
.
sign
.
toUpperCase
())
{
return
system
.
getResult
(
null
,
"签名错误"
);
return
system
.
getResult
(
null
,
"签名错误"
);
}
}
var
tokenInfo
=
await
this
.
getToken
(
pushData
.
actionProcess
);
var
tokenInfo
=
await
this
.
getToken
(
pushData
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
return
tokenInfo
;
}
}
var
param
=
{
var
param
=
{
actionProcess
:
pushData
.
actionProcess
,
actionProcess
:
pushData
.
actionProcess
,
actionType
:
"updateOrderPayStatus"
,
actionType
:
"updateOrderPayStatus"
,
actionBody
:
{
actionBody
:
{
channelUserId
:
pushData
.
user_phone
+
"_"
+
pushData
.
user_id
,
channelUserId
:
pushData
.
user_phone
+
"_"
+
pushData
.
user_id
,
payStatus
:
"yfk"
,
payStatus
:
"yfk"
,
needNo
:
"zzsbzc_"
+
pushData
.
order_no
,
needNo
:
"zzsbzc_"
+
pushData
.
order_no
,
needNoOrderNo
:
pushData
.
order_no
,
//---用此字段查找
needNoOrderNo
:
pushData
.
order_no
,
//---用此字段查找
buyerMoblie
:
pushData
.
mobile
buyerMoblie
:
pushData
.
mobile
},
},
isUser
:
"yes"
isUser
:
"yes"
};
}
;
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
)
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
this
.
info
({
this
.
info
({
optitle
:
"###处理公司宝推送的订单结果"
,
optitle
:
"###处理公司宝推送的订单结果
"
,
op
:
"/gsbhome/pushGsbPayOrder
"
,
op
:
"/gsbhome/pushGsbPayOrder"
,
content
:
"result="
+
JSON
.
stringify
(
resultUser
)
,
content
:
"result="
+
JSON
.
stringify
(
resultUser
),
clientIp
:
""
clientIp
:
""
});
});
if
(
!
resultUser
)
{
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"req error"
);
return
system
.
getResult
(
null
,
"req error"
);
}
}
return
resultUser
;
return
resultUser
;
}
catch
(
error
)
{
}
catch
(
error
)
{
this
.
error
(
{
this
.
error
({
optitle
:
"###处理公司宝推送的订单异常"
,
optitle
:
"###处理公司宝推送的订单异常
"
,
op
:
"/gsbhome/pushGsbPayOrder
"
,
op
:
"/gsbhome/pushGsbPayOrder"
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
)
,
content
:
"error="
+
JSON
.
stringify
(
error
.
stack
),
clientIp
:
""
clientIp
:
""
});
}
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
}
//----------------------------gsb------操作------------end
//----------------------------gsb------操作------------end
async
getUserByPin
(
pobj
,
qobj
,
req
)
{
async
getUserByPin
(
pobj
,
qobj
,
req
)
{
var
user
=
req
.
session
.
userPinInfo
;
var
user
=
req
.
session
.
userPinInfo
;
if
(
!
user
)
{
if
(
!
user
)
{
return
system
.
getResultFail
(
-
99
,
"user no login"
);
return
system
.
getResultFail
(
-
99
,
"user no login"
);
}
}
if
(
user
.
userpin
!=
pobj
.
userpin
)
{
if
(
user
.
userpin
!=
pobj
.
userpin
)
{
return
system
.
getResultFail
(
-
99
,
"user login error"
);
return
system
.
getResultFail
(
-
99
,
"user login error"
);
}
return
system
.
getResultSuccess
(
user
);
}
}
return
system
.
getResultSuccess
(
user
);
}
}
}
module
.
exports
=
tmqueryCtl
;
module
.
exports
=
tmqueryCtl
;
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