Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit befb7829
authored
Jul 11, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 登录接口更新
1 parent
2896b157
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
project-interface/src/main/java/com/dituhui/pea/user/IUser.java
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
project-interface/src/main/java/com/dituhui/pea/user/IUser.java
View file @
befb782
package
com
.
dituhui
.
pea
.
user
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.enums.ThirdPartyEnum
;
import
com.dituhui.pea.pojo.ThirdUserInfo
;
import
com.dituhui.pea.pojo.UserInfo
;
import
com.dituhui.pea.pojo.UserLoginDTO
;
import
com.dituhui.pea.pojo.WebResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* 用户相关接口
...
...
@@ -24,7 +24,7 @@ public interface IUser {
public
Result
<?>
userLogin
(
@RequestBody
UserLoginDTO
user
);
@RequestMapping
(
value
=
"/user/userInfo"
,
method
=
RequestMethod
.
GET
)
public
Result
<?>
getUserInfo
(
@Request
Header
(
name
=
"Authorization"
,
required
=
true
)
String
authorizatio
n
);
public
Result
<?>
getUserInfo
(
@Request
Param
(
name
=
"token"
)
String
toke
n
);
/**
* 获取当前登陆用户信息
...
...
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
View file @
befb782
...
...
@@ -58,7 +58,7 @@ public class UserService {
public
Result
<?>
userLogin
(
String
account
,
String
password
)
{
UserEntity
user
=
userDao
.
findByAccountAndPassword
(
account
,
SecureUtil
.
md5
(
password
));
if
(
null
=
=
user
)
{
if
(
null
!
=
user
)
{
// 生成token
UserLoginDTO
userDTO
=
BeanUtil
.
copyProperties
(
user
,
UserLoginDTO
.
class
);
// 生成token
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment