feat: adding create_id auto get from user
This commit is contained in:
parent
42d4ae1e89
commit
aca210336d
@ -63,6 +63,13 @@ public class AccountController {
|
||||
|
||||
@RequestMapping(path = "/addStoreAdmin",method = RequestMethod.POST)
|
||||
public R<JSONObject> addStoreAdmin(@RequestBody AccountAndStoreAdmin accountAndStoreAdmin){
|
||||
Collection<GrantedAuthority> authorities = ((User) SecurityContextHolder
|
||||
.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal())
|
||||
.getAuthorities();
|
||||
int id = Integer.parseInt(authorities.stream().filter(e -> e.getAuthority().startsWith("ROLE_id=")).findFirst().get().getAuthority().replace("ROLE_id=", ""));
|
||||
accountAndStoreAdmin.setCreateId(id);
|
||||
return accountService.addStoreAdmin(accountAndStoreAdmin);
|
||||
}
|
||||
/* @RequestMapping(path = "/debug",method = RequestMethod.GET)
|
||||
|
Loading…
x
Reference in New Issue
Block a user