feat(停用账号): 停用/删除即强制下线并点名成因——写入口、X-Auth-Reason 头、三面接线
- Java:AdminUserUpdateRequest 加 disabled 开关(不能停自己、归属门沿用既有闸), AccountExpiryService/AdminAuthSupport 抛停用/删除子类型,GlobalExceptionHandler 打 X-Auth-Reason: disabled|deleted 响应头;业务码保持 401 不变,不惊动三个既有消费者 - 后台管理:用户页停用/解除停用按钮 + 已停用徽章;拦截器把成因随 &auth= 带给登录页, 登录页分停用/删除两种文案;源码钉子棘轮基线按正路重生成 - 用户端:kick-handler 按 X-Auth-Reason 分支亮停用/删除标记(互斥清理), 登录页两段专属文案且各自关自动登录;跳转目标仍是 /login?expired=1 - 反假绿:摘掉成因头注入实测 2/4 红(变异自证),还原等值后复跑回绿
This commit is contained in:
@@ -21,6 +21,12 @@ const logoUrl = joinAdminPath('assets', 'logo.jpg')
|
||||
const inputType = computed(() => (showPassword.value ? 'text' : 'password'))
|
||||
/** 单设备登录:被新设备顶下线后跳回登录页(整页跳转携带 ?kicked=1) */
|
||||
const kickedNotice = computed(() => route.query.kicked === '1')
|
||||
/** 会话被服务端终止的成因(拦截器读 X-Auth-Reason 带成 ?auth=):停用/删除点名,其余不显示。 */
|
||||
const authNotice = computed(() => {
|
||||
if (route.query.auth === 'disabled') return '该账号已被管理员停用,本设备已退出登录。如有疑问请联系管理员。'
|
||||
if (route.query.auth === 'deleted') return '该账号已被删除,本设备已退出登录。'
|
||||
return ''
|
||||
})
|
||||
|
||||
function deviceId(): string {
|
||||
try {
|
||||
@@ -130,6 +136,7 @@ onMounted(() => {
|
||||
</header>
|
||||
<form novalidate @submit.prevent="submit">
|
||||
<p v-if="kickedNotice" class="kicked-msg" role="alert">该账号已在其他设备登录,本设备已下线。如非本人操作,请及时修改密码。</p>
|
||||
<p v-if="authNotice" class="kicked-msg" role="alert">{{ authNotice }}</p>
|
||||
<p v-if="errorMessage" class="error-msg" role="alert">{{ errorMessage }}</p>
|
||||
<div class="form-group">
|
||||
<label for="loginUsername">用户名</label>
|
||||
|
||||
Reference in New Issue
Block a user