Browse Source

baseURL 调整

冯诚 2 years ago
parent
commit
a74e58c421
4 changed files with 4 additions and 12 deletions
  1. 2 3
      .env
  2. 0 1
      src/env.d.ts
  3. 0 1
      src/service/repair.ts
  4. 2 7
      vite.config.ts

+ 2 - 3
.env

@@ -1,3 +1,2 @@
-#VITE_API_BASE=http://t.ptcrepair.com.au/care
-VITE_API_BASE=/api
-VITE_API_BASE2='/api2'
+#VITE_API_BASE=http://t.ptcrepair.com.au
+VITE_API_BASE=/api

+ 0 - 1
src/env.d.ts

@@ -9,7 +9,6 @@ declare module '*.vue' {
 
 interface ImportMetaEnv {
   VITE_API_BASE: string
-  VITE_API_BASE2: string
 }
 
 declare module 'nprogress'

+ 0 - 1
src/service/repair.ts

@@ -4,7 +4,6 @@ import request from './request'
 export function getShopList(params: any) {
   return request.get('/shop/list', {
     params,
-    baseURL: import.meta.env.VITE_API_BASE2,
     cancelable: true,
   })
 }

+ 2 - 7
vite.config.ts

@@ -20,18 +20,13 @@ export default defineConfig(({ command }) => ({
       },
     },
   },
-  base: '/ptc/',
+  base: '/spa/',
   server: {
     proxy: {
       '/api/': {
-        target: 'http://t.ptcrepair.com.au/care',
-        changeOrigin: true,
-        rewrite: path => path.replace(/^\/api/, ''),
-      },
-      '/api2/': {
         target: 'http://t.ptcrepair.com.au',
         changeOrigin: true,
-        rewrite: path => path.replace(/^\/api2/, ''),
+        rewrite: path => path.replace(/^\/api/, ''),
       },
     },
   },