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
1cfb40ac
Commit
1cfb40ac
authored
Oct 14, 2022
by
陈思聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 请求入口日志打印
parent
491315f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
center-channel/app/config/routes/api.js
+16
-0
No files found.
center-channel/app/config/routes/api.js
View file @
1cfb40ac
...
...
@@ -232,6 +232,11 @@ module.exports = function (app) {
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
const
self
=
this
;
try
{
console
.
log
(
'[request:web] 【host:】'
+
req
.
hostname
+
',【url:】'
+
req
.
path
+
',【headers:】'
+
(
req
.
headers
?
JSON
.
stringify
(
req
.
headers
):
""
)
+
',【params:】'
+
(
req
.
query
?
JSON
.
stringify
(
req
.
query
):
""
)
+
',【body:】'
+
(
req
.
body
?
JSON
.
stringify
(
req
.
body
):
""
))
}
catch
(
e
){
console
.
log
(
'[request:web] 打印请求入口日志报错:'
+
e
.
stack
)
}
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
res
.
end
(
JSON
.
stringify
(
result
));
...
...
@@ -410,6 +415,12 @@ module.exports = function (app) {
// return;
// });
app
.
all
(
"/api/*"
,
async
function
(
req
,
res
,
next
)
{
try
{
console
.
log
(
'[request:api] 【host:】'
+
req
.
hostname
+
',【url:】'
+
req
.
path
+
',【headers:】'
+
(
req
.
headers
?
JSON
.
stringify
(
req
.
headers
):
""
)
+
',【params:】'
+
(
req
.
query
?
JSON
.
stringify
(
req
.
query
):
""
)
+
',【body:】'
+
(
req
.
body
?
JSON
.
stringify
(
req
.
body
):
""
))
}
catch
(
e
){
console
.
log
(
'[request:api] 打印请求入口日志报错:'
+
e
.
stack
)
}
let
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
res
.
end
(
JSON
.
stringify
(
result
));
...
...
@@ -612,6 +623,11 @@ module.exports = function (app) {
//-----------------------新的模式---------ICP---------开始
app
.
all
(
"/icp/*"
,
async
function
(
req
,
res
,
next
)
{
try
{
console
.
log
(
'[request:icp] 【host:】'
+
req
.
hostname
+
',【url:】'
+
req
.
path
+
',【headers:】'
+
(
req
.
headers
?
JSON
.
stringify
(
req
.
headers
):
""
)
+
',【params:】'
+
(
req
.
query
?
JSON
.
stringify
(
req
.
query
):
""
)
+
',【body:】'
+
(
req
.
body
?
JSON
.
stringify
(
req
.
body
):
""
))
}
catch
(
e
){
console
.
log
(
'[request:icp] 打印请求入口日志报错:'
+
e
.
stack
)
}
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
res
.
end
(
JSON
.
stringify
(
result
));
...
...
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