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
b9bec908
Commit
b9bec908
authored
Dec 21, 2020
by
zxf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0bdca7a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
igirl-channel-gateway/app/base/utils/CtxBody.js
+5
-2
No files found.
igirl-channel-gateway/app/base/utils/CtxBody.js
View file @
b9bec908
const
uuid
=
require
(
'uuid/v4'
);
/**
/**
* 统一阿里返回结果
* 统一阿里返回结果
*/
*/
class
CtxBody
{
class
CtxBody
{
static
success
(
res
,
data
=
{})
{
static
success
(
res
,
data
=
{})
{
const
body
=
{
const
body
=
{
requestId
:
ctx
.
context
.
requestId
||
''
,
requestId
:
uuid
()
||
''
,
success
:
true
,
success
:
true
,
data
,
data
,
Code
:
data
.
Code
||
"200"
,
Code
:
data
.
Code
||
"200"
,
...
@@ -18,7 +21,7 @@ class CtxBody {
...
@@ -18,7 +21,7 @@ class CtxBody {
let
errorCode
=
error
.
code
||
'UNKNOWN.EXCEPTION'
;
let
errorCode
=
error
.
code
||
'UNKNOWN.EXCEPTION'
;
let
errorMsg
=
error
.
message
||
'发生未知异常'
;
let
errorMsg
=
error
.
message
||
'发生未知异常'
;
const
body
=
{
const
body
=
{
requestId
:
ctx
.
context
.
requestId
||
''
,
requestId
:
uuid
()
||
''
,
success
:
false
,
success
:
false
,
data
:
{},
data
:
{},
errorCode
:
errorCode
,
errorCode
:
errorCode
,
...
...
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