Skip to content

Commit

Permalink
chore: 使用常量替换vite.config.ts中的重复baseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Coooolfan committed Oct 27, 2024
1 parent 8aa09b4 commit f684ffb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

const baseURL = 'http://127.0.0.1:8001'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
Expand All @@ -13,11 +15,11 @@ export default defineConfig({
},
server: {
proxy: {
'/api/': 'http://127.0.0.1:8001',
'/media/': 'http://127.0.0.1:8001',
'/s/': 'http://127.0.0.1:8001',
'/file/': 'http://127.0.0.1:8001',
'/admin/': 'http://127.0.0.1:8001'
'/api/': baseURL,
'/media/': baseURL,
'/s/': baseURL,
'/file/': baseURL,
'/admin/': baseURL
}
}
})

0 comments on commit f684ffb

Please sign in to comment.