Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
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
zry
performance
Commits
5efc9724
Commit
5efc9724
authored
Mar 26, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbug
parent
64f5370e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
performance/Performance.Api/Filters/ActionsFilter.cs
+15
-19
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+2
-0
No files found.
performance/Performance.Api/Filters/ActionsFilter.cs
View file @
5efc9724
...
...
@@ -39,29 +39,25 @@ public ActionsFilter(ILoggerFactory factory, IMemoryCache cache, IHostingEnviron
var
kv
=
GetRequestContent
(
request
);
_logger
.
LogInformation
(
$"请求内容
{
request
.
Method
}
:
{
JsonHelper
.
Serialize
(
kv
)}
"
);
//token验证
if
(!
_env
.
IsDevelopment
())
var
arry
=
((
ControllerActionDescriptor
)
context
.
ActionDescriptor
).
MethodInfo
.
GetCustomAttributes
(
typeof
(
NoVerifyAttribute
),
true
);
if
(
arry
.
Length
==
0
)
{
var
arry
=
((
ControllerActionDescriptor
)
context
.
ActionDescriptor
).
MethodInfo
.
GetCustomAttributes
(
typeof
(
NoVerifyAttribute
),
true
);
if
(
arry
.
Length
==
0
)
var
token
=
kv
.
GetValue
(
"token"
,
""
);
var
user
=
_cache
.
Get
<
UserIdentity
>(
token
);
if
(
string
.
IsNullOrEmpty
(
token
)
||
user
==
null
||
!
user
.
Token
.
Equals
(
token
))
{
var
token
=
kv
.
GetValue
(
"token"
,
""
);
var
user
=
_cache
.
Get
<
UserIdentity
>(
token
);
if
(
string
.
IsNullOrEmpty
(
token
)
||
user
==
null
||
!
user
.
Token
.
Equals
(
token
))
{
var
response
=
new
ApiResponse
(
ResponseType
.
TokenError
,
"Token无效"
);
context
.
Result
=
new
ObjectResult
(
response
);
return
;
}
var
activeuid
=
kv
.
GetValue
<
Nullable
<
int
>>(
"activeuid"
);
if
(!
activeuid
.
HasValue
)
{
var
response
=
new
ApiResponse
(
ResponseType
.
TokenError
,
"Token无效"
);
context
.
Result
=
new
ObjectResult
(
response
);
return
;
}
var
response
=
new
ApiResponse
(
ResponseType
.
TokenError
,
"Token无效"
);
context
.
Result
=
new
ObjectResult
(
response
);
return
;
}
//var activeuid = kv.GetValue<Nullable<int>>("activeuid");
//if (!activeuid.HasValue)
//{
// var response = new ApiResponse(ResponseType.TokenError, "Token无效");
// context.Result = new ObjectResult(response);
// return;
//}
}
//验证请求参数
if
(!
context
.
ModelState
.
IsValid
)
{
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
5efc9724
...
...
@@ -34,5 +34,7 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
res_compute
>
Res_Compute
{
get
;
set
;
}
public
virtual
DbSet
<
cof_position
>
Cof_Position
{
get
;
set
;
}
public
virtual
DbSet
<
cof_workyear
>
Cof_Workyear
{
get
;
set
;
}
public
virtual
DbSet
<
im_specialunit
>
Im_SpecialUnit
{
get
;
set
;
}
public
virtual
DbSet
<
res_specialunit
>
Res_SpecialUnit
{
get
;
set
;
}
}
}
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