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
8417b7e4
Commit
8417b7e4
authored
4 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
02bda292
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+34
-4
No files found.
Edu.WebApi/Controllers/User/LoginController.cs
View file @
8417b7e4
using
System.Linq
;
using
System
;
using
System.Linq
;
using
Edu.Cache.User
;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
...
@@ -83,13 +84,42 @@ namespace Edu.WebApi.Controllers.User
...
@@ -83,13 +84,42 @@ namespace Edu.WebApi.Controllers.User
GroupName
=
model
.
GroupName
,
GroupName
=
model
.
GroupName
,
SchoolName
=
model
.
SchoolName
,
SchoolName
=
model
.
SchoolName
,
Token
=
token
,
Token
=
token
,
MenuList
=
treeList
,
MenuList
=
treeList
,
GroupLogo
=
model
.
GroupLogo
,
GroupLogo
=
model
.
GroupLogo
,
UserIcon
=
model
.
UserIcon
,
UserIcon
=
model
.
UserIcon
,
};
};
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Common
.
Config
.
JwtExpirTime
);
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Common
.
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
}
}
/// <summary>
/// 根据Token获取用户信息
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
public
ApiResult
GetUserInfo
()
{
int
Uid
=
0
;
try
{
Int32
.
TryParse
(
RequestParm
.
Uid
,
out
Uid
);
}
catch
(
Exception
ex
)
{
}
object
obj
=
new
object
();
if
(
Uid
>
0
)
{
obj
=
UserReidsCache
.
GetUserLoginInfo
(
Uid
);
return
ApiResult
.
Success
(
data
:
obj
);
}
else
{
return
ApiResult
.
Failed
();
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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