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
d1a82021
Commit
d1a82021
authored
Jan 04, 2021
by
王悦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉冗余代码
parent
1ec73e28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
421 deletions
+79
-421
igirl-channel-gateway/app/base/service/app.base.js
+9
-1
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
+70
-420
No files found.
igirl-channel-gateway/app/base/service/app.base.js
View file @
d1a82021
...
...
@@ -10,7 +10,7 @@ class AppServiceBase {
}
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
*/
async
verifySign
(
params
,
app_key
)
{
...
...
@@ -98,5 +98,13 @@ class AppServiceBase {
}
return
uuid
.
join
(
''
);
}
getResult
(
uuid
,
msg
){
return
{
"requestId"
:
uuid
,
"success"
:
!
msg
,
"errorMsg"
:
msg
||
""
,
"errorCode"
:
"ok"
};
}
}
module
.
exports
=
AppServiceBase
;
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
d1a82021
...
...
@@ -52,12 +52,7 @@ class UtilsNeedSve extends AppServiceBase {
var
self
=
this
;
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"getTokenInfo fail"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"getTokenInfo fail"
)
}
var
userpin
=
""
;
if
(
pobj
.
phone
&&!
pobj
.
mobile
){
...
...
@@ -96,45 +91,20 @@ class UtilsNeedSve extends AppServiceBase {
}
else
{
rtn
=
await
self
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
rtn
.
status
==
0
)
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
)
}
else
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
false
,
"errorMsg"
:
rtn
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
,
rtn
.
msg
)
}
}
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
...
...
@@ -167,22 +137,12 @@ class UtilsNeedSve extends AppServiceBase {
"actionBody"
:
pobj
}
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"无效应用"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"无效应用"
)
}
var
self
=
this
;
var
tokenInfo
=
await
this
.
getCenterTokenByApp
(
pobj
.
appInfo
);
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"getTokenInfo fail"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"getTokenInfo fail"
)
}
var
userpin
=
""
;
if
(
pobj
.
phone
&&!
pobj
.
mobile
){
...
...
@@ -221,68 +181,33 @@ class UtilsNeedSve extends AppServiceBase {
}
else
{
rtn
=
await
self
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
rtn
.
status
==
0
)
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
)
}
else
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
false
,
"errorMsg"
:
rtn
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
,
rtn
.
msg
)
}
}
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
//百度icp 2.3 请求
async
icpOrderStatus
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"无效应用"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"无效应用"
)
}
// 获取app token
// var tokenInfo = await this.getCenterToken();
var
tokenInfo
=
await
this
.
getCenterTokenByApp
(
pobj
.
appInfo
);
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
// 引用属性,channel依赖bizId order依赖intentionBizId
...
...
@@ -426,12 +351,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
userparam
.
actionBody
.
channelUserId
=
result
.
data
.
channelUserId
userparam
.
actionBody
.
mobile
=
result
.
data
.
publishMobile
...
...
@@ -445,12 +365,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
)
{
return
{
"requestId"
:
userpinResultTmp
.
requestId
,
"success"
:
false
,
"errorMsg"
:
userpinResultTmp
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
userpinResultTmp
.
requestId
,
userpinResultTmp
.
msg
)
}
// icpNotify
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
...
...
@@ -460,50 +375,25 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
//百度icp 2.4 请求 关闭icp订单
async
icpOrderClose
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"无效应用"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"无效应用"
)
}
// 获取app token
// var tokenInfo = await this.getCenterToken();
var
tokenInfo
=
await
this
.
getCenterTokenByApp
(
pobj
.
appInfo
);
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
var
sobj
=
{
...
...
@@ -514,20 +404,10 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
||
!
result
.
data
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
if
(
!
result
.
data
.
solutionContent
||
!
result
.
data
.
solutionContent
.
customerInfo
||
!
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
){
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"方案客户信息有误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
"方案客户信息有误"
)
}
// 获取userpin
var
userparam
=
{
...
...
@@ -541,12 +421,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
token
);
if
(
userpinResultTmp
.
status
!=
0
)
{
return
{
"requestId"
:
userpinResultTmp
.
requestId
,
"success"
:
false
,
"errorMsg"
:
userpinResultTmp
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
userpinResultTmp
.
requestId
,
userpinResultTmp
.
msg
)
}
var
closeobj
=
{
"actionType"
:
"icpOrderClose"
,
...
...
@@ -555,28 +430,13 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
closeobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
// -------------提交Icp需求--------庄冰2020.10.21-------百度Icp接入使用--------end------------------
async
paySuccess
(
pobj
)
{
...
...
@@ -586,12 +446,7 @@ class UtilsNeedSve extends AppServiceBase {
}
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
// return { "message": "success", "data": {}, "code": 200 }
}
var
userpin
=
""
;
...
...
@@ -612,22 +467,12 @@ class UtilsNeedSve extends AppServiceBase {
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
// return { "message": "网络错误", "data": {}, "code": -102 }
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
// return { "message": "网络错误", "data": {}, "code": -102 }
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
}
//带userpin请求
...
...
@@ -636,30 +481,15 @@ class UtilsNeedSve extends AppServiceBase {
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
// return { "message": "网络错误", "data": {}, "code": -102 }
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
// return { "message": "true", "data": {}, "code": 200 }
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
// return { "message": result.msg, "data": {}, "code": -102 }
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
...
...
@@ -671,43 +501,23 @@ class UtilsNeedSve extends AppServiceBase {
var
self
=
this
;
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/ic/springBoard"
;
var
token
=
tokenInfo
.
data
.
token
;
var
rtn
=
await
self
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
rtn
.
status
==
0
)
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
)
}
else
{
return
{
"requestId"
:
rtn
.
requestId
,
"success"
:
false
,
"errorMsg"
:
rtn
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
rtn
.
requestId
,
rtn
.
msg
)
}
}
//商标建案后通知启服通保存TM_单号
async
tmNotifyChannel
(
pobj
){
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
pobj
.
intentionBizId
=
pobj
.
bizId
...
...
@@ -724,12 +534,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
userparam
.
actionBody
.
channelUserId
=
result
.
data
.
channelUserId
userparam
.
actionBody
.
mobile
=
result
.
data
.
publishMobile
...
...
@@ -742,12 +547,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
)
{
return
{
"requestId"
:
userpinResultTmp
.
requestId
,
"success"
:
false
,
"errorMsg"
:
userpinResultTmp
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
userpinResultTmp
.
requestId
,
userpinResultTmp
.
msg
)
}
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
sobj
=
{
...
...
@@ -756,28 +556,13 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
this
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
//icp 2.3 请求
async
queryOrderState
(
pobj
)
{
...
...
@@ -785,12 +570,7 @@ class UtilsNeedSve extends AppServiceBase {
// 获取app token
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
// 引用属性,channel依赖bizId order依赖intentionBizId
...
...
@@ -809,12 +589,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
pobj
.
mobile
=
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
}
...
...
@@ -834,12 +609,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
userparam
.
actionBody
.
channelUserId
=
result
.
data
.
channelUserId
userparam
.
actionBody
.
mobile
=
result
.
data
.
publishMobile
...
...
@@ -853,12 +623,7 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
)
{
return
{
"requestId"
:
userpinResultTmp
.
requestId
,
"success"
:
false
,
"errorMsg"
:
userpinResultTmp
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
userpinResultTmp
.
requestId
,
userpinResultTmp
.
msg
)
}
// icpNotify
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/need/springBoard"
;
...
...
@@ -868,40 +633,20 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
// 2020 0925 lin 新增 阿里文网文 服务商侧提供接口2.1 提交用户需求给服务商
async
submitNeedAliEsp
(
pobj
)
{
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
this
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
var
userpin
=
""
;
...
...
@@ -920,22 +665,12 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/auth/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
// return { "message": "网络错误", "data": {}, "code": -102 }
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
}
//带userpin请求
...
...
@@ -950,28 +685,13 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
...
...
@@ -979,12 +699,7 @@ class UtilsNeedSve extends AppServiceBase {
async
needCloseAliEsp
(
pobj
)
{
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
var
userpin
=
""
;
...
...
@@ -1002,22 +717,12 @@ class UtilsNeedSve extends AppServiceBase {
var
url
=
settings
.
centerChannelUrl
()
+
"/api/auth/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
// return { "message": "网络错误", "data": {}, "code": -102 }
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
}
//带userpin请求
...
...
@@ -1028,28 +733,13 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
...
...
@@ -1057,12 +747,7 @@ class UtilsNeedSve extends AppServiceBase {
async
produceNoticeAliEsp
(
pobj
)
{
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
this
.
getUUID
(),
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
this
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
var
userpin
=
""
;
...
...
@@ -1074,28 +759,13 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
...
...
@@ -1103,12 +773,7 @@ class UtilsNeedSve extends AppServiceBase {
async
soulutionFeebackAliEsp
(
pobj
)
{
var
tokenInfo
=
await
this
.
getCenterToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
())
}
var
token
=
tokenInfo
.
data
.
token
;
var
userpin
=
""
;
...
...
@@ -1120,28 +785,13 @@ class UtilsNeedSve extends AppServiceBase {
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
self
.
getUUID
(),
"网络错误"
)
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
==
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
)
}
else
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
return
this
.
getResult
(
result
.
requestId
,
result
.
msg
)
}
}
}
...
...
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