mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
修改mybatis自动插入的creator updater 字段为用户昵称
This commit is contained in:
+26
@@ -25,6 +25,8 @@ public class WebFrameworkUtils {
|
||||
|
||||
private static final String REQUEST_ATTRIBUTE_COMMON_RESULT = "common_result";
|
||||
|
||||
private static final String REQUEST_ATTRIBUTE_LOGIN_USER_NAME = "login-user-name";
|
||||
|
||||
public static final String HEADER_ORGAN_ID = "organ-id";
|
||||
|
||||
/**
|
||||
@@ -56,6 +58,10 @@ public class WebFrameworkUtils {
|
||||
request.setAttribute(REQUEST_ATTRIBUTE_LOGIN_USER_ID, userId);
|
||||
}
|
||||
|
||||
public static void setLoginUserName(ServletRequest request, String nickname) {
|
||||
request.setAttribute(REQUEST_ATTRIBUTE_LOGIN_USER_NAME, nickname);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户类型
|
||||
*
|
||||
@@ -80,6 +86,20 @@ public class WebFrameworkUtils {
|
||||
return (Long) request.getAttribute(REQUEST_ATTRIBUTE_LOGIN_USER_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前用户的昵称,从请求中
|
||||
* 注意:该方法仅限于 framework 框架使用!!!
|
||||
*
|
||||
* @param request 请求
|
||||
* @return 用户编号
|
||||
*/
|
||||
private static String getLoginUserName(HttpServletRequest request) {
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
return (String) request.getAttribute(REQUEST_ATTRIBUTE_LOGIN_USER_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前用户的类型
|
||||
* 注意:该方法仅限于 web 相关的 framework 组件使用!!!
|
||||
@@ -116,6 +136,12 @@ public class WebFrameworkUtils {
|
||||
return getLoginUserId(request);
|
||||
}
|
||||
|
||||
public static String getLoginUserName() {
|
||||
HttpServletRequest request = getRequest();
|
||||
return getLoginUserName(request);
|
||||
}
|
||||
|
||||
|
||||
public static Integer getTerminal() {
|
||||
HttpServletRequest request = getRequest();
|
||||
if (request == null) {
|
||||
|
||||
Reference in New Issue
Block a user