Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loginservice
Overview
Overview
Details
Activity
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
lanmw
loginservice
Commits
0b75b62a
Commit
0b75b62a
authored
Apr 17, 2023
by
zhix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
深圳地铁单点新增用户权限初始化更换角色授权接口
parent
04b03863
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
LoginManagement.java
src/main/java/com/keymobile/login/api/LoginManagement.java
+3
-3
AuthService.java
src/main/java/com/keymobile/login/service/AuthService.java
+5
-2
No files found.
src/main/java/com/keymobile/login/api/LoginManagement.java
View file @
0b75b62a
...
@@ -137,9 +137,9 @@ public class LoginManagement {
...
@@ -137,9 +137,9 @@ public class LoginManagement {
log
.
info
(
"新增单点用户成功:{}"
,
userDetailByTokenInfo
.
get
(
"given_name"
));
log
.
info
(
"新增单点用户成功:{}"
,
userDetailByTokenInfo
.
get
(
"given_name"
));
//初始权限
//初始权限
List
<
Map
<
String
,
Object
>>
newUser
=
authService
.
getUserByName
(
userDetailByTokenInfo
.
get
(
"unique_name"
));
List
<
Map
<
String
,
Object
>>
newUser
=
authService
.
getUserByName
(
userDetailByTokenInfo
.
get
(
"unique_name"
));
List
<
Long
>
userIds
=
new
ArrayList
<>();
//
List<Long> userIds = new ArrayList<>();
userIds
.
add
(
Long
.
parseLong
(
newUser
.
get
(
0
).
get
(
"id"
).
toString
()));
//
userIds.add(Long.parseLong(newUser.get(0).get("id").toString()));
authService
.
dataRoles
(
oauth2Properties
.
getInitRoleId
(),
userIds
);
authService
.
addDataRole
(
oauth2Properties
.
getInitRoleId
(),
Long
.
parseLong
(
newUser
.
get
(
0
).
get
(
"id"
).
toString
())
);
log
.
info
(
"初始化权限id:{},新增用户{}权限初始化成功。"
,
oauth2Properties
.
getInitRoleId
(),
userDetailByTokenInfo
.
get
(
"given_name"
));
log
.
info
(
"初始化权限id:{},新增用户{}权限初始化成功。"
,
oauth2Properties
.
getInitRoleId
(),
userDetailByTokenInfo
.
get
(
"given_name"
));
}
}
UserDetails
userDetails
=
customizedUserDetailService
.
loadUserByUsername
(
userDetailByTokenInfo
.
get
(
"unique_name"
));
UserDetails
userDetails
=
customizedUserDetailService
.
loadUserByUsername
(
userDetailByTokenInfo
.
get
(
"unique_name"
));
...
...
src/main/java/com/keymobile/login/service/AuthService.java
View file @
0b75b62a
...
@@ -15,8 +15,11 @@ public interface AuthService {
...
@@ -15,8 +15,11 @@ public interface AuthService {
@PostMapping
(
value
=
"/users"
)
@PostMapping
(
value
=
"/users"
)
Map
<
String
,
Object
>
addUser
(
@RequestBody
Map
<
String
,
Object
>
user
);
Map
<
String
,
Object
>
addUser
(
@RequestBody
Map
<
String
,
Object
>
user
);
@PostMapping
(
value
=
"/dataRoles/{dataRoleId}/users/sync"
)
// @PostMapping(value = "/dataRoles/{dataRoleId}/users/sync")
Map
<
String
,
Object
>
dataRoles
(
@PathVariable
(
value
=
"dataRoleId"
)
Long
roleId
,
@RequestParam
(
value
=
"userIds"
)
List
<
Long
>
userIds
);
// Map<String, Object> dataRoles(@PathVariable(value = "dataRoleId") Long roleId, @RequestParam(value = "userIds") List<Long> userIds);
@PostMapping
(
value
=
"/dataRoles/{dataRoleId}/users/{userId}"
)
Map
<
String
,
Object
>
addDataRole
(
@PathVariable
(
value
=
"dataRoleId"
)
Long
roleId
,
@RequestParam
(
value
=
"userId"
)
Long
userId
);
}
}
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