mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
提交用户的检查修改
This commit is contained in:
@@ -101,8 +101,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
|||||||
// }
|
// }
|
||||||
if(cuser==null) {
|
if(cuser==null) {
|
||||||
// 判断token中获取的值是否当前系统的,不是则告诉前端来获取
|
// 判断token中获取的值是否当前系统的,不是则告诉前端来获取
|
||||||
if(tokenData.containsKey("userId")) {
|
if(tokenData.containsKey("uId")) {
|
||||||
error(response,302,"系统无当前用户,需同步");
|
error(response,302,"token 错误");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error(response,401,"请重新登录");
|
error(response,401,"请重新登录");
|
||||||
@@ -127,9 +127,9 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
|||||||
|
|
||||||
private CurrentUser convertByMap(Map<String, String> data) {
|
private CurrentUser convertByMap(Map<String, String> data) {
|
||||||
if(!data.containsKey("aid")) {
|
if(!data.containsKey("aid")) {
|
||||||
//在这里写根据原系统UserId去查询用户信息。然后生成CurrentUser 返回就可以了
|
//修改为新的接口,通过uId获取
|
||||||
if(data.containsKey("userId")) {
|
if(data.containsKey("uId")) {
|
||||||
User user = userService.getBySysId(data.get("userId"));
|
User user = userService.get(data.get("uId"));
|
||||||
if(user != null){
|
if(user != null){
|
||||||
CurrentUser cuser=new CurrentUser();
|
CurrentUser cuser=new CurrentUser();
|
||||||
cuser.setAccountId(user.getId());
|
cuser.setAccountId(user.getId());
|
||||||
@@ -141,8 +141,22 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if(data.containsKey("userId")) {
|
||||||
|
// User user = userService.getBySysId(data.get("userId"));
|
||||||
|
// if(user != null){
|
||||||
|
// CurrentUser cuser=new CurrentUser();
|
||||||
|
// cuser.setAccountId(user.getId());
|
||||||
|
// cuser.setName(user.getName());
|
||||||
|
// cuser.setCode(user.getUserNo());
|
||||||
|
// cuser.setDepartId(user.getDepartId());
|
||||||
|
// return cuser;
|
||||||
|
// }else {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
//此处用于本地登录的情况,直接从token中获取,不需要再查询一次了
|
||||||
CurrentUser cuser=new CurrentUser();
|
CurrentUser cuser=new CurrentUser();
|
||||||
cuser.setAccountId(data.get("aid"));
|
cuser.setAccountId(data.get("aid"));
|
||||||
cuser.setName(data.get("name"));
|
cuser.setName(data.get("name"));
|
||||||
|
|||||||
Reference in New Issue
Block a user