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
View File
@@ -2,8 +2,14 @@
const isProduction = process.env.NODE_ENV === 'prod';
// 从 window 对象获取路径前缀(由后端注入或通过 API 获取)
const getPathPrefix = () => {
return window.__URL_PATH_PREFIX__ || '';
};
const config = {
apiUrl: isProduction ? '' : 'http://localhost:8000',
pathPrefix: getPathPrefix(),
};
export default config;