feat: 登陆修改
This commit is contained in:
@@ -15,17 +15,15 @@ public class LoginUserUtil {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static String getUserId() {
|
public static String getUserId() {
|
||||||
String userId = "WY8J26MH23";
|
String userId = null;
|
||||||
try {
|
try {
|
||||||
if(!StringUtils.isNotBlank(userId)){
|
Subject subject = SecurityUtils.getSubject();
|
||||||
Subject subject = SecurityUtils.getSubject();
|
Object object=subject.getPrincipal();
|
||||||
Object object=subject.getPrincipal();
|
if(object!=null){
|
||||||
if(object!=null){
|
String json = JSONObject.toJSONString(object);
|
||||||
String json = JSONObject.toJSONString(object);
|
if(json!=null && json.length()>0){
|
||||||
if(json!=null && json.length()>0){
|
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
|
||||||
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
|
userId=userInfo.get("id").toString();
|
||||||
userId=userInfo.get("id").toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (UnavailableSecurityManagerException e) {
|
} catch (UnavailableSecurityManagerException e) {
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ public class UserInfoEOController extends BaseController<UserInfoEO> {
|
|||||||
@ApiOperation(value = "查找用户信息接口")
|
@ApiOperation(value = "查找用户信息接口")
|
||||||
@GetMapping("/getByUserInfoCode")
|
@GetMapping("/getByUserInfoCode")
|
||||||
//@RequiresPermissions("person:userInfo: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 userInfoEO =new UserInfoEO();
|
||||||
userInfoEO.setUserId(userId);
|
userInfoEO.setUserId(userIdFilter(userId));
|
||||||
userInfoEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue());
|
userInfoEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue());
|
||||||
UserInfoEO getInfo = userInfoEOService.getUserEOAndInfoEOByUserCode(userInfoEO);
|
UserInfoEO getInfo = userInfoEOService.getUserEOAndInfoEOByUserCode(userInfoEO);
|
||||||
if(getInfo!=null){
|
if(getInfo!=null){
|
||||||
@@ -84,6 +84,16 @@ public class UserInfoEOController extends BaseController<UserInfoEO> {
|
|||||||
return Result.success(getInfo);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刘寅楠
|
* 刘寅楠
|
||||||
|
|||||||
Reference in New Issue
Block a user