feat(认证/通知): 单设备登录互踢 + 站内通知铃铛系统
- 单设备登录:登录成功即 last-login-wins 绑定 users.machine;非超管旧 token 在下一次受保护请求抛 4011 下线,超管豁免;仅认 token 内签名 deviceId,不用请求头。 前端两端接入踢下线跳转(?kicked=1 提示),V118 清空历史 machine - 站内通知:新增 notification 模块(任务失败扫描 / 密钥欠费 / 下游服务探测三类来源), 前后台铃铛组件 + 轮询;后台列表按主管数据范围(UserDataScopeSupport)过滤;V116 建表 均已于 2026-09-13 部署上线,此次补提交源码(此前仅存在于已部署 JAR/构建产物中)
This commit is contained in:
@@ -18,6 +18,8 @@ const errorMessage = ref('')
|
||||
const logoUrl = joinAdminPath('assets', 'logo.jpg')
|
||||
|
||||
const inputType = computed(() => (showPassword.value ? 'text' : 'password'))
|
||||
/** 单设备登录:被新设备顶下线后跳回登录页(整页跳转携带 ?kicked=1) */
|
||||
const kickedNotice = computed(() => route.query.kicked === '1')
|
||||
|
||||
function deviceId(): string {
|
||||
try {
|
||||
@@ -120,6 +122,7 @@ onMounted(() => {
|
||||
<p class="login-subtitle">使用管理员账号进入数富AI运营后台。</p>
|
||||
</header>
|
||||
<form novalidate @submit.prevent="submit">
|
||||
<p v-if="kickedNotice" class="kicked-msg" role="alert">该账号已在其他设备登录,本设备已下线。如非本人操作,请及时修改密码。</p>
|
||||
<p v-if="errorMessage" class="error-msg" role="alert">{{ errorMessage }}</p>
|
||||
<div class="form-group">
|
||||
<label for="loginUsername">用户名</label>
|
||||
@@ -296,6 +299,20 @@ button, input { font: inherit; }
|
||||
border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800;
|
||||
}
|
||||
|
||||
/* 单设备登录:被新设备顶下线的提示 */
|
||||
.kicked-msg {
|
||||
display: flex; align-items: flex-start; gap: 9px;
|
||||
margin: -4px 0 18px; padding: 11px 12px;
|
||||
border: 1px solid #e0cf9f; border-radius: 11px; background: #fbf4e2; color: #8a6a1f;
|
||||
font-size: 13px; line-height: 1.55;
|
||||
}
|
||||
.kicked-msg::before {
|
||||
content: "!";
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
flex: 0 0 18px; width: 18px; height: 18px;
|
||||
border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800;
|
||||
}
|
||||
|
||||
.btn-login {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 9px;
|
||||
width: 100%; min-height: 48px; padding: 12px 18px;
|
||||
|
||||
Reference in New Issue
Block a user