多设备登录修改
This commit is contained in:
parent
920c4ec0b7
commit
c5d78f46db
|
|
@ -234,7 +234,8 @@ service.interceptors.response.use(
|
||||||
// 未设置状态码则默认成功状态
|
// 未设置状态码则默认成功状态
|
||||||
const code = res.data.code || 200
|
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 (
|
if (
|
||||||
res.request.responseType === 'blob' ||
|
res.request.responseType === 'blob' ||
|
||||||
|
|
@ -242,9 +243,10 @@ service.interceptors.response.use(
|
||||||
) {
|
) {
|
||||||
return res.data
|
return res.data
|
||||||
}
|
}
|
||||||
|
console.log(msg);
|
||||||
|
|
||||||
// 账号在其他设备登录的安全提示(基于后端返回信息关键词识别)
|
// 账号在其他设备登录的安全提示(基于后端返回信息关键词识别)
|
||||||
const otherDeviceLogin = /检测到您的账号已在其他设备登录/.test(String(msg || ''))
|
const otherDeviceLogin = /multipleDeviceLogin/.test(String(msg || ''))
|
||||||
if (otherDeviceLogin) {
|
if (otherDeviceLogin) {
|
||||||
if (!isRelogin.show) {
|
if (!isRelogin.show) {
|
||||||
isRelogin.show = true
|
isRelogin.show = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue