Merge branch 'develop_3' into 'develop_master'

feat: 登陆修改

See merge request !13
This commit is contained in:
super_liu
2021-06-23 07:26:03 +00:00
2 changed files with 21 additions and 13 deletions
@@ -15,17 +15,15 @@ public class LoginUserUtil {
*
*/
public static String getUserId() {
String userId = "WY8J26MH23";
String userId = null;
try {
if(!StringUtils.isNotBlank(userId)){
Subject subject = SecurityUtils.getSubject();
Object object=subject.getPrincipal();
if(object!=null){
String json = JSONObject.toJSONString(object);
if(json!=null && json.length()>0){
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
userId=userInfo.get("id").toString();
}
Subject subject = SecurityUtils.getSubject();
Object object=subject.getPrincipal();
if(object!=null){
String json = JSONObject.toJSONString(object);
if(json!=null && json.length()>0){
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
userId=userInfo.get("id").toString();
}
}
} catch (UnavailableSecurityManagerException e) {
@@ -62,11 +62,11 @@ public class UserInfoEOController extends BaseController<UserInfoEO> {
@ApiOperation(value = "查找用户信息接口")
@GetMapping("/getByUserInfoCode")
//@RequiresPermissions("person:userInfo:getByUserInfoCode")
public ResponseMessage<UserInfoEO> getByUserInfoCode() throws Exception {
public ResponseMessage<UserInfoEO> getByUserInfoCode(String userId) throws Exception {
//获取当前登录人
String userId= LoginUserUtil.getUserId();
// String userId= LoginUserUtil.getUserId();
UserInfoEO userInfoEO =new UserInfoEO();
userInfoEO.setUserId(userId);
userInfoEO.setUserId(userIdFilter(userId));
userInfoEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue());
UserInfoEO getInfo = userInfoEOService.getUserEOAndInfoEOByUserCode(userInfoEO);
if(getInfo!=null){
@@ -84,6 +84,16 @@ public class UserInfoEOController extends BaseController<UserInfoEO> {
return Result.success(getInfo);
}
private String userIdFilter(String str){
String result = "";
if(str.contains("?_t")){
result = str.split("\\?_t")[0];
}else {
result = str;
}
return result;
}
/**
* 刘寅楠