feat: 个人信息页面.
This commit is contained in:
@@ -25,6 +25,8 @@ public interface Const extends com.orion.lang.constant.Const, FieldConst {
|
||||
|
||||
Integer DEFAULT_SORT = 10;
|
||||
|
||||
int LOGIN_HISTORY_COUNT = 30;
|
||||
|
||||
Long NONE_ID = -1L;
|
||||
|
||||
Integer DEFAULT_VERSION = 1;
|
||||
|
||||
@@ -46,7 +46,7 @@ public enum ErrorCode implements CodeInfo {
|
||||
|
||||
// -------------------- 自定义 - 业务 --------------------
|
||||
|
||||
OTHER_DEVICE_LOGIN(700, "该账号于 {} 已在其他设备登陆 {}({})"),
|
||||
OTHER_DEVICE_LOGIN(700, "该账号于 {} 已在其他设备登录 {}({})"),
|
||||
|
||||
USER_DISABLED(701, "当前用户已禁用"),
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface ErrorMessage {
|
||||
|
||||
String USERNAME_PASSWORD_ERROR = "用户名或密码错误";
|
||||
|
||||
String MAX_LOGIN_FAILED = "登陆失败次数已上限";
|
||||
String MAX_LOGIN_FAILED = "登录失败次数已上限";
|
||||
|
||||
String HISTORY_ABSENT = "历史值不存在";
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PrettyLogPrinterInterceptor extends AbstractLogPrinterInterceptor {
|
||||
if (!Strings.isEmpty(summary)) {
|
||||
requestLog.append("\tsummary: ").append(summary).append('\n');
|
||||
}
|
||||
// 登陆用户
|
||||
// 登录用户
|
||||
Long loginUserId = securityHolder.getLoginUserId();
|
||||
if (loginUserId != null) {
|
||||
requestLog.append("\tuser: ").append(loginUserId).append('\n');
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RowLogPrinterInterceptor extends AbstractLogPrinterInterceptor impl
|
||||
if (!Strings.isEmpty(summary)) {
|
||||
fields.put(SUMMARY, summary);
|
||||
}
|
||||
// 登陆用户
|
||||
// 登录用户
|
||||
fields.put(USER, securityHolder.getLoginUserId());
|
||||
// http
|
||||
if (request != null) {
|
||||
|
||||
@@ -106,6 +106,14 @@ public class DataQuery<T> {
|
||||
return then;
|
||||
}
|
||||
|
||||
public DataQuery<T> limit(int limit) {
|
||||
return this.last(Const.LIMIT + Const.SPACE + limit);
|
||||
}
|
||||
|
||||
public DataQuery<T> limit(int offset, int limit) {
|
||||
return this.last(Const.LIMIT + Const.SPACE + offset + Const.COMMA + limit);
|
||||
}
|
||||
|
||||
public DataQuery<T> only() {
|
||||
return this.last(Const.LIMIT_1);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class SecurityUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户id
|
||||
* 获取当前 userId
|
||||
*
|
||||
* @return id
|
||||
*/
|
||||
@@ -78,6 +78,16 @@ public class SecurityUtils {
|
||||
return loginUser != null ? loginUser.getId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前 username
|
||||
*
|
||||
* @return username
|
||||
*/
|
||||
public static String getLoginUsername() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
return loginUser != null ? loginUser.getUsername() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前用户
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user