Change to hash routing, webuiInitialize controls project prefix

This commit is contained in:
choizhang
2025-03-14 17:00:36 +08:00
parent 7bf2d51bd0
commit 10c23aabfd
11 changed files with 14 additions and 1147 deletions

View File

@@ -1,5 +1,5 @@
import axios, { AxiosError } from 'axios'
import { backendBaseUrl } from '@/lib/constants'
import { backendBaseUrl, webuiPrefix } from '@/lib/constants'
import { errorMessage } from '@/lib/utils'
import { useSettingsStore } from '@/stores/settings'
import { useAuthStore } from '@/stores/state'
@@ -169,8 +169,8 @@ axiosInstance.interceptors.response.use(
sessionStorage.clear();
useAuthStore.getState().logout();
if (window.location.pathname !== '/login') {
window.location.href = '/login';
if (window.location.pathname !== `${webuiPrefix}/#/login`) {
window.location.href = `${webuiPrefix}/#/login`;
}
return Promise.reject(error);