feat: 登陆修改
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user