fix: 停用登录设备绑定(注释 machine 写入/重绑与 check_login 不一致拒绝)便于多设备/联调;Vue 首页背景图改 /bg.jpg 并补 public 资源、首页/登录布局居中修复

This commit is contained in:
2026-09-07 11:19:42 +08:00
parent d2301db292
commit e6cf4c2461
4 changed files with 25 additions and 1 deletions
@@ -48,6 +48,10 @@ public class AuthService {
}
boolean isAdmin = user.getIsAdmin() != null && user.getIsAdmin() == 1;
// ---- 设备绑定逻辑临时停用(便于多设备 / 浏览器联调)----
// 原逻辑:首次登录写入 machine;设备指纹变化时把 machine 重绑到当前设备。
// 注释期间登录不写、不校验 machine,任何设备均可登录,仅保留日志便于排查。
/*
String stored = user.getMachine() == null ? "" : user.getMachine().trim();
if (stored.isEmpty()) {
loginUserMapper.update(null, new LambdaUpdateWrapper<LoginUserEntity>()
@@ -67,6 +71,9 @@ public class AuthService {
log.info("[auth] device match userId={} isAdmin={} device={}",
user.getId(), isAdmin, deviceId);
}
*/
log.info("[auth] login (device-bind disabled) userId={} isAdmin={} device={}",
user.getId(), isAdmin, deviceId);
return buildResult(user, deviceId, isAdmin);
}
@@ -97,6 +104,8 @@ public class AuthService {
Object claimDevice = claims.get("deviceId");
device = claimDevice == null ? "" : claimDevice.toString().trim();
}
// ---- 设备绑定逻辑临时停用:设备不一致不再拒绝登录态,仅保留告警日志 ----
/*
if (!stored.isEmpty() && !device.isEmpty() && !stored.equals(device)) {
if (isAdmin) {
log.warn("[auth] check_login device mismatch but admin bypass userId={} stored={} current={}",
@@ -107,6 +116,11 @@ public class AuthService {
throw new BusinessException(401, "当前设备与首次登录设备不一致");
}
}
*/
if (!stored.isEmpty() && !device.isEmpty() && !stored.equals(device)) {
log.warn("[auth] check_login device mismatch (bypass) userId={} stored={} current={}",
user.getId(), stored, device);
}
return buildResult(user, stored.isEmpty() ? device : stored, isAdmin);
}