feat: generate permission sql for stocktake modules and implement single-device login restriction

This commit is contained in:
DXC
2026-03-20 09:11:54 +08:00
parent faea0379da
commit 4223a95f10
6 changed files with 147 additions and 4 deletions

View File

@ -162,6 +162,15 @@ service.interceptors.response.use(
// 核心401 错误处理 + 无感刷新
// ============================================================
if (status === 401) {
// 0. 检查是否是互踢情况(账号在其他设备登录)
if (data?.reason === 'token_mismatch') {
message = '您的账号已在其他设备登录,请重新登录'
ElMessage.warning(message)
localStorage.clear()
window.location.href = '/login'
return Promise.reject(error)
}
// 1. 如果是登录接口的 401不执行刷新
if (isLoginEndpoint) {
message = data?.msg || '用户名或密码错误'