添加sso
This commit is contained in:
+5
-1
@@ -15,7 +15,11 @@ http.interceptors.request.use((config) => {
|
||||
http.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response?.status === 401 && !error.config?.url?.endsWith('/auth/login')) {
|
||||
const isAuthenticationRequest =
|
||||
error.config?.url?.endsWith('/auth/login') ||
|
||||
error.config?.url?.endsWith('/auth/sso/exchange') ||
|
||||
error.config?.url?.endsWith('/auth/sso/bind')
|
||||
if (error.response?.status === 401 && !isAuthenticationRequest) {
|
||||
localStorage.removeItem('jiaowu_token')
|
||||
localStorage.removeItem('jiaowu_user')
|
||||
goLogin(location.pathname + location.search + location.hash)
|
||||
|
||||
Reference in New Issue
Block a user