Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
a7565f31
Commit
a7565f31
authored
Nov 12, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增配置
parent
ab475454
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
Config.cs
Edu.Common/Config.cs
+4
-1
GlobalKey.cs
Edu.Common/GlobalKey.cs
+5
-0
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+2
-2
WebApiTokenHelper.cs
Edu.WebApi/Helper/WebApiTokenHelper.cs
+2
-2
No files found.
Edu.Common/Config.cs
View file @
a7565f31
using
Microsoft.Extensions.Configuration
;
using
Aspose.Words.Lists
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
using
NPOI.OpenXmlFormats
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text.RegularExpressions
;
...
...
Edu.Common/GlobalKey.cs
View file @
a7565f31
...
...
@@ -19,5 +19,10 @@
/// 用户验证信息
/// </summary>
public
const
string
JWT_User_Key
=
"edu_userInfo"
;
/// <summary>
/// ERP用户TokenKey
/// </summary>
public
const
string
JWT_ERP_User_Key
=
"userInfo"
;
}
}
Edu.WebApi/Controllers/User/LoginController.cs
View file @
a7565f31
...
...
@@ -85,8 +85,8 @@ namespace Edu.WebApi.Controllers.User
groupId
=
model
.
Group_Id
};
string
token
=
WebApiTokenHelper
.
CreateToken
(
eduUserInfo
);
string
erpToken
=
WebApiTokenHelper
.
CreateToken
(
erpUserInfo
);
string
token
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_User_Key
,
eduUserInfo
);
string
erpToken
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_ERP_User_Key
,
erpUserInfo
);
var
treeList
=
menuModule
.
GetTreeMenuModule
(
new
Model
.
ViewModel
.
System
.
RB_Menu_ViewModel
()
{
MenuType
=
accountType
...
...
Edu.WebApi/Helper/WebApiTokenHelper.cs
View file @
a7565f31
...
...
@@ -18,7 +18,7 @@ namespace Edu.WebApi.Helper
/// </summary>
/// <param name="requestFromEnum">来源</param>
/// <returns></returns>
public
static
string
CreateToken
(
IUserInfoToken
userInfo
)
public
static
string
CreateToken
(
string
userKey
,
IUserInfoToken
userInfo
)
{
IDateTimeProvider
provider
=
new
UtcDateTimeProvider
();
var
now
=
provider
.
GetNow
().
AddMinutes
(-
1
);
...
...
@@ -28,7 +28,7 @@ namespace Edu.WebApi.Helper
{
{
"iat"
,
secondsSinceEpoch
},
{
"exp"
,
secondsSinceEpoch
+
Common
.
Config
.
JwtExpirTime
},
{
Common
.
GlobalKey
.
JWT_User_
Key
,
userInfo
}
{
user
Key
,
userInfo
}
};
IJwtAlgorithm
algorithm
=
new
HMACSHA256Algorithm
();
IJsonSerializer
serializer
=
new
JsonNetSerializer
();
...
...
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