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
f95c265c
Commit
f95c265c
authored
Jul 03, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
41318641
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
brg-user-center/app/base/api/api.base.js
+17
-15
No files found.
brg-user-center/app/base/api/api.base.js
View file @
f95c265c
...
@@ -31,26 +31,28 @@ class APIBase {
...
@@ -31,26 +31,28 @@ class APIBase {
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
doexecMethod
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
var
action
=
this
.
userCenterAction
[
req
.
body
.
Action
];
var
action
=
this
.
userCenterAction
[
req
.
body
.
Action
];
if
(
req
.
body
.
Action
&&
action
)
{
var
reqParams
=
{
actionType
:
pobj
.
actionType
,
actionBody
:
null
};
if
(
pobj
.
Action
&&
action
)
{
reqParams
.
actionType
=
action
;
reqParams
.
actionBody
=
pobj
;
var
userId
=
req
.
body
[
"SubAccountUin"
]
||
req
.
body
[
"Uin"
];
var
userId
=
req
.
body
[
"SubAccountUin"
]
||
req
.
body
[
"Uin"
];
req
.
body
.
UserId
=
userId
||
"100000013569"
;
reqParams
.
actionBody
.
UserId
=
userId
||
"100000013569"
;
req
.
body
.
actionType
=
action
;
}
else
{
req
.
body
.
actionBody
=
req
.
body
;
reqParams
.
actionBody
=
pobj
.
actionBody
;
}
var
param
=
{
pobj
:
pobj
,
query
:
query
}
}
console
.
log
(
JSON
.
stringify
(
param
),
".....base........req..........."
)
console
.
log
(
JSON
.
stringify
(
reqParams
),
"....req......base......"
);
try
{
try
{
var
result
=
await
this
[
methodname
](
pobj
,
query
,
req
);
var
result
=
await
this
[
methodname
](
reqParams
,
query
,
req
);
if
(
!
result
)
{
if
(
!
result
)
{
result
=
system
.
getResult
(
null
,
"请求的方法返回值为空"
);
result
=
system
.
getResult
(
null
,
"请求的方法返回值为空"
);
}
}
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
var
tmpResult
=
reqParams
.
actionType
&&
reqParams
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
this
.
execClient
.
execLogs
(
"reqPath:"
+
req
.
path
+
"执行结果"
,
param
,
"brg-user-center-apibase"
,
tmpResult
,
null
);
this
.
execClient
.
execLogs
(
"reqPath:"
+
req
.
path
+
"执行结果"
,
reqParams
,
"brg-user-center-apibase"
,
tmpResult
,
null
);
result
.
requestId
=
result
.
requestId
||
uuid
.
v1
();
result
.
requestId
=
result
.
requestId
||
uuid
.
v1
();
if
(
req
.
body
.
Action
&&
this
.
userCenterAction
[
req
.
body
.
Action
]
)
{
if
(
pobj
.
Action
&&
action
)
{
result
=
await
this
.
handleTxResult
(
result
);
result
=
await
this
.
handleTxResult
(
result
);
delete
req
.
body
[
"Action"
];
delete
req
.
body
[
"Action"
];
}
//处理tx返回数据
}
//处理tx返回数据
...
@@ -60,8 +62,8 @@ class APIBase {
...
@@ -60,8 +62,8 @@ class APIBase {
console
.
log
(
stackStr
,
"api调用出现异常,请联系管理员.........."
)
console
.
log
(
stackStr
,
"api调用出现异常,请联系管理员.........."
)
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
stackStr
);
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
stackStr
);
rtnerror
.
requestId
=
uuid
.
v1
();
rtnerror
.
requestId
=
uuid
.
v1
();
this
.
execClient
.
execLogs
(
"reqPath:"
+
req
.
path
+
"执行异常"
,
param
,
"brg-user-center-apibase"
,
null
,
stackStr
);
this
.
execClient
.
execLogs
(
"reqPath:"
+
req
.
path
+
"执行异常"
,
reqParams
,
"brg-user-center-apibase"
,
null
,
stackStr
);
if
(
req
.
body
.
Action
&&
this
.
userCenterAction
[
req
.
body
.
Action
]
)
{
if
(
pobj
.
Action
&&
action
)
{
return
{
return
{
"Response"
:
{
"Response"
:
{
"Status"
:
-
200
,
"Status"
:
-
200
,
...
...
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