fix: 停用登录设备绑定(注释 machine 写入/重绑与 check_login 不一致拒绝)便于多设备/联调;Vue 首页背景图改 /bg.jpg 并补 public 资源、首页/登录布局居中修复
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.9 MiB |
@@ -271,13 +271,18 @@ onMounted(() => {
|
||||
body {
|
||||
font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
|
||||
background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
|
||||
url("/static/bg.jpg") center/cover no-repeat;
|
||||
url("/bg.jpg") center/cover no-repeat;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.home-root {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.header {
|
||||
|
||||
@@ -216,11 +216,16 @@ body {
|
||||
font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
|
||||
background: #d8e4ec;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.legacy-login-root {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.header {
|
||||
|
||||
Reference in New Issue
Block a user