Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
a3318375 committed Mar 26, 2024
1 parent 60780ce commit 994a1ae
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL='https://mock.apifox.com/m1/4220056-0-default'
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL='https://mock.apifox.com/m1/4220056-0-default'
2 changes: 1 addition & 1 deletion src/services/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface HttpResponse {

// 创建axios实例对象
const api: AxiosInstance = axios.create({
//baseURL: import.meta.env.BASE_URL,
baseURL: import.meta.env.VITE_API_BASE_URL,
timeout: 10 * 1000
})

Expand Down
6 changes: 0 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'vite'
import { resolve } from 'path'
import react from '@vitejs/plugin-react-swc'
import { viteMockServe } from "vite-plugin-mock";
import generouted from '@generouted/react-router/plugin'

export default defineConfig({
Expand All @@ -13,10 +12,5 @@ export default defineConfig({
plugins: [
react(),
generouted(),
viteMockServe({
// default
mockPath: 'src/mock', // mock目录地址 demo中创建的是mock
enable: true, // 是否在开发环境中启用
}),
],
})

0 comments on commit 994a1ae

Please sign in to comment.