添加sso

This commit is contained in:
2026-08-03 15:57:40 +08:00 Unverified
parent fb812268d7
commit 6bee29a351
16 changed files with 917 additions and 5 deletions
+5 -1
View File
@@ -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)