feat: add url prefix

This commit is contained in:
engigu
2026-01-15 20:05:00 +08:00
parent 18ad967df3
commit 4b15146cdb
10 changed files with 240 additions and 17 deletions
+6 -1
View File
@@ -10,8 +10,13 @@ import { toast } from "vue-sonner"
const ERR_NETWORK = "ERR_NETWORK";
// 获取路径前缀
const getPathPrefix = () => {
return config.pathPrefix || '';
};
const request = axios.create({
baseURL: config.apiUrl,
baseURL: config.apiUrl + getPathPrefix(),
timeout: 50000,
withCredentials: true,
});
+5 -4
View File
@@ -20,7 +20,8 @@ import router from './router';
} catch (_) {}
})();
const app = createApp(App)
app.use(router)
app.use(pinia)
app.mount('#app')
const app = createApp(App);
app.use(router);
app.use(pinia);
app.mount('#app');
+7
View File
@@ -0,0 +1,7 @@
declare global {
interface Window {
__URL_PATH_PREFIX__?: string;
}
}
export {};