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
e999bedb
Commit
e999bedb
authored
Jan 20, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增缓存字段
parent
6ed9df02
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
UserReidsCache.cs
Edu.Cache/User/UserReidsCache.cs
+12
-1
UserInfo.cs
Edu.Model/CacheModel/UserInfo.cs
+5
-0
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+8
-4
No files found.
Edu.Cache/User/UserReidsCache.cs
View file @
e999bedb
...
@@ -105,6 +105,10 @@ namespace Edu.Cache.User
...
@@ -105,6 +105,10 @@ namespace Edu.Cache.User
/// 账号仓储层对象
/// 账号仓储层对象
/// </summary>
/// </summary>
private
static
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
static
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 部门仓储层对象
/// </summary>
private
static
readonly
RB_DepartmentRepository
departmentRepository
=
new
RB_DepartmentRepository
();
/// <summary>
/// <summary>
/// 获取用户登录信息
/// 获取用户登录信息
...
@@ -138,12 +142,18 @@ namespace Edu.Cache.User
...
@@ -138,12 +142,18 @@ namespace Edu.Cache.User
})?.
FirstOrDefault
();
})?.
FirstOrDefault
();
if
(
model
!=
null
)
if
(
model
!=
null
)
{
{
var
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
Model
.
ViewModel
.
User
.
RB_Department_ViewModel
()
{
DeptId
=
model
.
Dept_Id
,
Group_Id
=
model
.
Group_Id
,
ManagerIds
=
model
.
Id
.
ToString
()
});
userInfo
=
new
UserInfo
userInfo
=
new
UserInfo
{
{
Id
=
model
.
Id
,
Id
=
model
.
Id
,
Group_Id
=
model
.
Group_Id
,
Group_Id
=
model
.
Group_Id
,
School_Id
=
model
.
School_Id
,
School_Id
=
model
.
School_Id
,
AccountType
=
model
.
AccountType
,
AccountType
=
model
.
AccountType
,
AccountName
=
model
.
AccountName
,
AccountName
=
model
.
AccountName
,
GroupName
=
model
.
GroupName
,
GroupName
=
model
.
GroupName
,
SchoolName
=
model
.
SchoolName
,
SchoolName
=
model
.
SchoolName
,
...
@@ -165,6 +175,7 @@ namespace Edu.Cache.User
...
@@ -165,6 +175,7 @@ namespace Edu.Cache.User
IsTenCccUser
=
model
.
IsTenCccUser
,
IsTenCccUser
=
model
.
IsTenCccUser
,
IsCourseConsultant
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
CourseConsultant
)
?
1
:
0
,
IsCourseConsultant
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
CourseConsultant
)
?
1
:
0
,
IsMarket
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
?
1
:
0
,
IsMarket
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
?
1
:
0
,
IsManager
=
(
deptList
?.
Count
??
0
)
>
0
?
1
:
0
,
};
};
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
Id
.
ToString
(),
userInfo
,
Common
.
Config
.
JwtExpirTime
);
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
Id
.
ToString
(),
userInfo
,
Common
.
Config
.
JwtExpirTime
);
}
}
...
...
Edu.Model/CacheModel/UserInfo.cs
View file @
e999bedb
...
@@ -177,6 +177,11 @@ namespace Edu.Model.CacheModel
...
@@ -177,6 +177,11 @@ namespace Edu.Model.CacheModel
/// 是否是市场(1-是)
/// 是否是市场(1-是)
/// </summary>
/// </summary>
public
int
IsMarket
{
get
;
set
;
}
public
int
IsMarket
{
get
;
set
;
}
/// <summary>
/// 部门负责人(1-是)
/// </summary>
public
int
IsManager
{
get
;
set
;
}
}
}
/// <summary>
/// <summary>
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
e999bedb
...
@@ -54,6 +54,11 @@ namespace Edu.WebApi.Controllers.User
...
@@ -54,6 +54,11 @@ namespace Edu.WebApi.Controllers.User
private
readonly
StudentModule
studentModule
=
new
StudentModule
();
private
readonly
StudentModule
studentModule
=
new
StudentModule
();
/// <summary>
/// 部门处理类对象
/// </summary>
private
readonly
DepartmentModule
departmentModule
=
new
DepartmentModule
();
[
HttpGet
]
[
HttpGet
]
[
HttpPost
]
[
HttpPost
]
[
AllowAnonymous
]
[
AllowAnonymous
]
...
@@ -153,10 +158,6 @@ namespace Edu.WebApi.Controllers.User
...
@@ -153,10 +158,6 @@ namespace Edu.WebApi.Controllers.User
string
erpToken
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_ERP_User_Key
,
erpUserInfo
);
string
erpToken
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_ERP_User_Key
,
erpUserInfo
);
#
region
获取甲鹤教育
Token
#
region
获取甲鹤教育
Token
string
JHTenantId
=
Config
.
JHTenantId
;
string
JHTenantId
=
Config
.
JHTenantId
;
string
JHMallBaseId
=
Config
.
JHMallBaseId
;
string
JHMallBaseId
=
Config
.
JHMallBaseId
;
...
@@ -190,6 +191,7 @@ namespace Edu.WebApi.Controllers.User
...
@@ -190,6 +191,7 @@ namespace Edu.WebApi.Controllers.User
#
endregion
#
endregion
var
treeList
=
menuModule
.
GetPostMenuTreeModule
(
new
Model
.
ViewModel
.
System
.
RB_Menu_ViewModel
()
var
treeList
=
menuModule
.
GetPostMenuTreeModule
(
new
Model
.
ViewModel
.
System
.
RB_Menu_ViewModel
()
{
{
MenuType
=
accountType
MenuType
=
accountType
...
@@ -198,6 +200,7 @@ namespace Edu.WebApi.Controllers.User
...
@@ -198,6 +200,7 @@ namespace Edu.WebApi.Controllers.User
var
actionList
=
menuModule
.
GetPostMenuFunctionListModule
(
model
.
Post_Id
.
ToString
());
var
actionList
=
menuModule
.
GetPostMenuFunctionListModule
(
model
.
Post_Id
.
ToString
());
//上传配置
//上传配置
var
uploadConfig
=
publicModule
.
GetFileStoreList
(
new
Model
.
Public
.
RB_File_Store
()
{
Group_Id
=
model
.
Group_Id
,
IsDefault
=
1
})?.
FirstOrDefault
();
var
uploadConfig
=
publicModule
.
GetFileStoreList
(
new
Model
.
Public
.
RB_File_Store
()
{
Group_Id
=
model
.
Group_Id
,
IsDefault
=
1
})?.
FirstOrDefault
();
var
deptList
=
departmentModule
.
GetDepartmentListModule
(
new
RB_Department_ViewModel
()
{
DeptId
=
model
.
Dept_Id
,
Group_Id
=
model
.
Group_Id
,
ManagerIds
=
model
.
Id
.
ToString
()
});
UserInfo
obj
=
new
UserInfo
UserInfo
obj
=
new
UserInfo
{
{
...
@@ -225,6 +228,7 @@ namespace Edu.WebApi.Controllers.User
...
@@ -225,6 +228,7 @@ namespace Edu.WebApi.Controllers.User
PostId
=
model
.
Post_Id
,
PostId
=
model
.
Post_Id
,
PostName
=
model
.
PostName
,
PostName
=
model
.
PostName
,
Email
=
model
.
Email
,
Email
=
model
.
Email
,
IsManager
=(
deptList
?.
Count
??
0
)>
0
?
1
:
0
,
IsTenCccUser
=
model
.
IsTenCccUser
,
IsTenCccUser
=
model
.
IsTenCccUser
,
IsCourseConsultant
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
CourseConsultant
)
?
1
:
0
,
IsCourseConsultant
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
CourseConsultant
)
?
1
:
0
,
IsMarket
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
?
1
:
0
,
IsMarket
=
(
model
!=
null
&&
model
.
UserRole
==
UserRoleEnum
.
MarketPersion
)
?
1
:
0
,
...
...
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