Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
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
zengtianlai3
ioc_sixiang_license
Commits
fb517438
Commit
fb517438
authored
Feb 02, 2023
by
ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取用户信息接口
parent
05425b4a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
12 deletions
+32
-12
LoginController.java
.../java/iot/sixiang/license/controller/LoginController.java
+0
-4
UserController.java
...n/java/iot/sixiang/license/controller/UserController.java
+12
-2
LoginVo.java
...e/src/main/java/iot/sixiang/license/model/vo/LoginVo.java
+0
-6
UserDetailVO.java
.../main/java/iot/sixiang/license/model/vo/UserDetailVO.java
+20
-0
No files found.
license/src/main/java/iot/sixiang/license/controller/LoginController.java
View file @
fb517438
...
@@ -6,7 +6,6 @@ import io.swagger.annotations.Api;
...
@@ -6,7 +6,6 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.consts.ResultCode
;
import
iot.sixiang.license.consts.ResultCode
;
import
iot.sixiang.license.entity.User
;
import
iot.sixiang.license.entity.User
;
import
iot.sixiang.license.entity.UserPermission
;
import
iot.sixiang.license.jwt.JwtUtil
;
import
iot.sixiang.license.jwt.JwtUtil
;
import
iot.sixiang.license.jwt.LoginUser
;
import
iot.sixiang.license.jwt.LoginUser
;
import
iot.sixiang.license.jwt.UserUtils
;
import
iot.sixiang.license.jwt.UserUtils
;
...
@@ -32,7 +31,6 @@ import springfox.documentation.annotations.ApiIgnore;
...
@@ -32,7 +31,6 @@ import springfox.documentation.annotations.ApiIgnore;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletRequest
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* 登录Controller
* 登录Controller
...
@@ -100,10 +98,8 @@ public class LoginController {
...
@@ -100,10 +98,8 @@ public class LoginController {
// if (code.equals(UserUtils.getEmailCode(userName)) && curCodeDate.before(UserUtils.getEmailCodeExpTime(userName))) {
// if (code.equals(UserUtils.getEmailCode(userName)) && curCodeDate.before(UserUtils.getEmailCodeExpTime(userName))) {
if
(
code
.
equals
(
"123456"
))
{
if
(
code
.
equals
(
"123456"
))
{
String
token
=
JwtUtil
.
createToken
(
dbUser
);
String
token
=
JwtUtil
.
createToken
(
dbUser
);
List
<
UserPermission
>
permissions
=
userPermissionService
.
getPermissionById
(
user
.
getUserId
());
LoginVo
loginVo
=
new
LoginVo
();
LoginVo
loginVo
=
new
LoginVo
();
loginVo
.
setAuthorization
(
token
);
loginVo
.
setAuthorization
(
token
);
loginVo
.
setPermissionList
(
permissions
);
loginVo
.
setUpdateTime
(
user
.
getUpdateTime
());
loginVo
.
setUpdateTime
(
user
.
getUpdateTime
());
UserUtils
.
setToken
(
dbUser
.
getUserId
(),
token
);
UserUtils
.
setToken
(
dbUser
.
getUserId
(),
token
);
UserUtils
.
setTokenExp
(
dbUser
.
getUserId
(),
JwtUtil
.
getTokenExp
());
UserUtils
.
setTokenExp
(
dbUser
.
getUserId
(),
JwtUtil
.
getTokenExp
());
...
...
license/src/main/java/iot/sixiang/license/controller/UserController.java
View file @
fb517438
package
iot
.
sixiang
.
license
.
controller
;
package
iot
.
sixiang
.
license
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.lang.Validator
;
import
cn.hutool.core.lang.Validator
;
import
com.acc.secret.util.RSAUtil
;
import
com.acc.secret.util.RSAUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -25,6 +26,7 @@ import iot.sixiang.license.model.ResResult;
...
@@ -25,6 +26,7 @@ import iot.sixiang.license.model.ResResult;
import
iot.sixiang.license.model.dto.AssignUserPermissionDTO
;
import
iot.sixiang.license.model.dto.AssignUserPermissionDTO
;
import
iot.sixiang.license.model.dto.UpdateNotifyDTO
;
import
iot.sixiang.license.model.dto.UpdateNotifyDTO
;
import
iot.sixiang.license.model.vo.UserDeleteVO
;
import
iot.sixiang.license.model.vo.UserDeleteVO
;
import
iot.sixiang.license.model.vo.UserDetailVO
;
import
iot.sixiang.license.model.vo.UserUpdatePwdVo
;
import
iot.sixiang.license.model.vo.UserUpdatePwdVo
;
import
iot.sixiang.license.model.vo.UserVo
;
import
iot.sixiang.license.model.vo.UserVo
;
import
iot.sixiang.license.service.PermissionService
;
import
iot.sixiang.license.service.PermissionService
;
...
@@ -253,13 +255,21 @@ public class UserController {
...
@@ -253,13 +255,21 @@ public class UserController {
@ApiOperation
(
value
=
"获取用户信息接口"
,
notes
=
"获取用户信息"
)
@ApiOperation
(
value
=
"获取用户信息接口"
,
notes
=
"获取用户信息"
)
@GetMapping
(
"get"
)
@GetMapping
(
"get"
)
@MyLog
(
title
=
"获取用户信息"
,
businessType
=
BusinessType
.
SELECT
)
@MyLog
(
title
=
"获取用户信息"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
<
User
>
getUserPermissionList
()
{
public
ResResult
<
User
DetailVO
>
getUserPermissionList
()
{
String
userId
=
UserUtils
.
getLoginUserId
();
String
userId
=
UserUtils
.
getLoginUserId
();
if
(
StringUtils
.
isEmpty
(
userId
))
{
if
(
StringUtils
.
isEmpty
(
userId
))
{
return
ResResult
.
failed
().
setMsgValue
(
"请重新登录"
);
return
ResResult
.
failed
().
setMsgValue
(
"请重新登录"
);
}
}
User
user
=
userService
.
getUserById
(
Integer
.
parseInt
(
userId
));
User
user
=
userService
.
getUserById
(
Integer
.
parseInt
(
userId
));
return
ResResult
.
success
().
goRecord
(
user
);
if
(
user
==
null
)
{
return
ResResult
.
failed
();
}
else
{
List
<
UserPermission
>
permissions
=
userPermissionService
.
getPermissionById
(
user
.
getUserId
());
UserDetailVO
userDetailVO
=
new
UserDetailVO
();
BeanUtil
.
copyProperties
(
user
,
userDetailVO
);
userDetailVO
.
setPermissionList
(
permissions
);
return
ResResult
.
success
().
goRecord
(
userDetailVO
);
}
}
}
...
...
license/src/main/java/iot/sixiang/license/model/vo/LoginVo.java
View file @
fb517438
package
iot
.
sixiang
.
license
.
model
.
vo
;
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
iot.sixiang.license.entity.Permission
;
import
iot.sixiang.license.entity.UserPermission
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* Created by m33 on 2022/6/14 18:51
* Created by m33 on 2022/6/14 18:51
...
@@ -17,9 +14,6 @@ public class LoginVo {
...
@@ -17,9 +14,6 @@ public class LoginVo {
@ApiModelProperty
(
"token"
)
@ApiModelProperty
(
"token"
)
private
String
authorization
;
private
String
authorization
;
@ApiModelProperty
(
"用户权限列表"
)
private
List
<
UserPermission
>
permissionList
;
@ApiModelProperty
(
"更新时间"
)
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
private
Date
updateTime
;
}
}
license/src/main/java/iot/sixiang/license/model/vo/UserDetailVO.java
0 → 100644
View file @
fb517438
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
iot.sixiang.license.entity.User
;
import
iot.sixiang.license.entity.UserPermission
;
import
lombok.Data
;
import
java.util.List
;
/**
* Created by m33
* Date 2023/2/2 16:53
* Description
*/
@Data
public
class
UserDetailVO
extends
User
{
@ApiModelProperty
(
"用户权限列表"
)
private
List
<
UserPermission
>
permissionList
;
}
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