You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
853 B
36 lines
853 B
2 years ago
|
package com.dxhy.common.controller;
|
||
|
|
||
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
||
|
import com.alibaba.fastjson.JSON;
|
||
|
import com.dxhy.common.utils.BaseContextHandler;
|
||
|
import com.dxhy.common.vo.UserInfo;
|
||
|
|
||
|
/**
|
||
|
* Controller公共组件
|
||
|
*
|
||
|
* @author jiaohongyang
|
||
|
*/
|
||
|
public abstract class AbstractController {
|
||
|
|
||
|
public String getUserName() {
|
||
|
return BaseContextHandler.getUsername();
|
||
|
}
|
||
|
|
||
|
public String getLoginName() {
|
||
|
return BaseContextHandler.getLonginname();
|
||
|
}
|
||
|
|
||
|
public String getUserId() {
|
||
|
return BaseContextHandler.getUserID();
|
||
|
}
|
||
|
|
||
|
public UserInfo getUserInfo() {
|
||
|
String userInfo = BaseContextHandler.getUserInfo();
|
||
|
UserInfo user = null;
|
||
|
if (StringUtils.isNotBlank(userInfo)) {
|
||
|
user = JSON.parseObject(userInfo, UserInfo.class);
|
||
|
}
|
||
|
return user;
|
||
|
}
|
||
|
}
|