feat: add url prefix
This commit is contained in:
+6
-1
@@ -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
@@ -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');
|
||||
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
__URL_PATH_PREFIX__?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user