feat: 个人信息页面.

This commit is contained in:
lijiahang
2023-10-31 19:07:48 +08:00
parent 6c9aabd4fd
commit 3fef9b8ae2
42 changed files with 647 additions and 148 deletions

View File

@@ -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;

View File

@@ -46,7 +46,7 @@ public enum ErrorCode implements CodeInfo {
// -------------------- 自定义 - 业务 --------------------
OTHER_DEVICE_LOGIN(700, "该账号于 {} 已在其他设备登 {}({})"),
OTHER_DEVICE_LOGIN(700, "该账号于 {} 已在其他设备登 {}({})"),
USER_DISABLED(701, "当前用户已禁用"),

View File

@@ -49,7 +49,7 @@ public interface ErrorMessage {
String USERNAME_PASSWORD_ERROR = "用户名或密码错误";
String MAX_LOGIN_FAILED = "失败次数已上限";
String MAX_LOGIN_FAILED = "失败次数已上限";
String HISTORY_ABSENT = "历史值不存在";

View File

@@ -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');

View File

@@ -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) {

View File

@@ -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);
}

View File

@@ -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;
}
/**
* 设置当前用户
*