Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
a0e64181
Commit
a0e64181
authored
Sep 03, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增配置
parent
03d620c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
ApiExceptionFilterAttribute.cs
Mall.WebApi/Filter/ApiExceptionFilterAttribute.cs
+2
-4
Program.cs
Mall.WebApi/Program.cs
+2
-0
No files found.
Mall.WebApi/Filter/ApiExceptionFilterAttribute.cs
View file @
a0e64181
...
...
@@ -34,13 +34,11 @@ namespace Mall.WebApi.Filter
//记录错误日志
if
(
context
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
]
!=
null
)
{
LogHelper
.
Write
(
context
.
Exception
,
$"ApiExceptionFilterAttribute_InvokeServiceMethod请求地址:
{
Config
.
GetFilePath
(
context
.
HttpContext
.
Request
.
GetAbsoluteUri
())}
,请求参数:
{
JsonConvert
.
SerializeObject
(
context
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
].
ToString
())}
"
);
Console
.
WriteLine
(
context
.
Exception
);
LogHelper
.
Write
(
context
.
Exception
,
$"ApiExceptionFilterAttribute_InvokeServiceMethod_1:
{
Config
.
GetFilePath
(
context
.
HttpContext
.
Request
.
GetAbsoluteUri
())}
,请求参数:
{
JsonConvert
.
SerializeObject
(
context
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
].
ToString
())}
"
);
}
else
{
LogHelper
.
Write
(
context
.
Exception
,
$"ApiExceptionFilterAttribute_InvokeServiceMethod请求地址:
{
Config
.
GetFilePath
(
context
.
HttpContext
.
Request
.
GetAbsoluteUri
())}
"
);
Console
.
WriteLine
(
context
.
Exception
);
LogHelper
.
Write
(
context
.
Exception
,
$"ApiExceptionFilterAttribute_InvokeServiceMethod_2:
{
Config
.
GetFilePath
(
context
.
HttpContext
.
Request
.
GetAbsoluteUri
())}
"
);
}
var
robj
=
new
ApiResult
()
...
...
Mall.WebApi/Program.cs
View file @
a0e64181
...
...
@@ -26,6 +26,8 @@ namespace Mall.WebApi
options
.
AllowSynchronousIO
=
true
;
//设置应用服务器Kestrel请求体最大为50MB
options
.
Limits
.
MaxRequestBodySize
=
52428800
;
//解决并发异常
options
.
Limits
.
MinRequestBodyDataRate
=
null
;
});
webBuilder
.
UseStartup
<
Startup
>().
UseIIS
();
});
...
...
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