@@ -1,2 +1,2 @@
-VITE_API_BASE=https://mockapi.eolink.com/9A5KfUCbe99f2b17204d98bfebe7a77757ce256af3e4e90
-#VITE_API_BASE=http://t.ptcrepair.com.au/care
+#VITE_API_BASE=https://mockapi.eolink.com/9A5KfUCbe99f2b17204d98bfebe7a77757ce256af3e4e90
+VITE_API_BASE=http://t.ptcrepair.com.au/care
@@ -18,7 +18,8 @@ interface ResponseData<T = any> {
}
const _axios = axios.create({
- baseURL: import.meta.env.VITE_API_BASE,
+ // baseURL: import.meta.env.VITE_API_BASE,
+ baseURL: '/api',
})
const cancelMethods: Record<string, Canceler> = {}
@@ -21,4 +21,13 @@ export default defineConfig(({ command }) => ({
},
base: '/ptc/',
+ server: {
+ proxy: {
+ '/api': {
+ target: 'http://t.ptcrepair.com.au/care',
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/api/, ''),
+ },
}))