Commit 481715ef by 前端

Merge branch 'huy_v2.8.1' into 'v2.8.1'

修复登出跳转问题

See merge request !5
2 parents afe295fc 0c234138
/*
* @Description:
* @Author: huyue
* @Date: 2022-08-23 11:04:56
* @LastEditors: huyue
* @LastEditTime: 2022-08-23 22:24:25
*/
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios' import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
import { Toast } from 'vant'; import { Toast } from 'vant';
import qs from 'qs' import qs from 'qs'
...@@ -65,7 +72,8 @@ service.interceptors.response.use((r: AxiosResponse) => { ...@@ -65,7 +72,8 @@ service.interceptors.response.use((r: AxiosResponse) => {
case code_error_value + '': case code_error_value + '':
if (errValue && errValue == errId_logout_value) { if (errValue && errValue == errId_logout_value) {
localStorage.removeItem('sessionId') localStorage.removeItem('sessionId')
location.replace('/login') const [href] = window.location.href.split('/#/')
location.href = `${href}/#/login`
} }
Toast(res.message) Toast(res.message)
break break
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!