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
9d977657
Commit
9d977657
authored
Jun 03, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
440d91c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
ApiFilterAttribute.cs
Mall.WebApi/Filter/ApiFilterAttribute.cs
+14
-14
No files found.
Mall.WebApi/Filter/ApiFilterAttribute.cs
View file @
9d977657
...
...
@@ -98,20 +98,20 @@ namespace Mall.WebApi.Filter
string
cachedKey
=
SecurityHelper
.
MD5
(
string
.
Format
(
"cmd={0}&token={1}"
,
controllerName
+
"/"
+
actionName
,
token
));
try
{
if
(
UserReidsCache
.
Exists
(
cachedKey
))
//判断表单是否重复提交
{
actionContext
.
Result
=
new
Microsoft
.
AspNetCore
.
Mvc
.
JsonResult
(
new
ApiResult
{
resultCode
=
(
int
)
ResultCode
.
FormRepeatSubmit
,
message
=
"表单重复提交,请稍后再试"
,
data
=
null
});
}
else
{
//默认2秒钟之内不能重复提交
UserReidsCache
.
Set
(
cachedKey
,
1
,
2
);
}
//
if (UserReidsCache.Exists(cachedKey))//判断表单是否重复提交
//
{
//
actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult(new ApiResult
//
{
//
resultCode = (int)ResultCode.FormRepeatSubmit,
//
message = "表单重复提交,请稍后再试",
//
data = null
//
});
//
}
//
else
//
{
//
//默认2秒钟之内不能重复提交
//
UserReidsCache.Set(cachedKey, 1, 2);
//
}
}
catch
{
...
...
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