多设备登录修改

This commit is contained in:
cwchen 2025-09-25 17:01:43 +08:00
parent 920c4ec0b7
commit c5d78f46db
1 changed files with 4 additions and 2 deletions

View File

@ -234,7 +234,8 @@ service.interceptors.response.use(
// 未设置状态码则默认成功状态
const code = res.data.code || 200
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
const msg = res.data.msg === 'multipleDeviceLogin' ? res.data.msg :
(errorCode[code] || res.data.msg || errorCode['default'])
// 二进制数据则直接返回
if (
res.request.responseType === 'blob' ||
@ -242,9 +243,10 @@ service.interceptors.response.use(
) {
return res.data
}
console.log(msg);
// 账号在其他设备登录的安全提示(基于后端返回信息关键词识别)
const otherDeviceLogin = /检测到您的账号已在其他设备登录/.test(String(msg || ''))
const otherDeviceLogin = /multipleDeviceLogin/.test(String(msg || ''))
if (otherDeviceLogin) {
if (!isRelogin.show) {
isRelogin.show = true