Browse Source

chore: 添加开发环境代理

master
AaronWu 5 months ago
parent
commit
f5b1080a18
  1. 7
      .env.development
  2. 5
      .env.production
  3. 22
      vite.config.ts

7
.env.development

@ -2,15 +2,16 @@
# @Author: AaronWu 2463371514@qq.com
# @Date: 2025-03-31 15:12:17
# @LastEditors: AaronWu 2463371514@qq.com
# @LastEditTime: 2025-04-02 09:15:01
# @LastEditTime: 2025-07-07 11:36:29
# @FilePath: /IssueSupportManage/.env.development
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 只在开发模式中被载入
# 网站前缀
# VITE_BASE_API_URL = http://192.168.2.110:8089/server/
VITE_BASE_API_URL = http://43.137.2.78:8085/server/
# VITE_BASE_API_URL = http://192.168.2.64:8089/server/
# VITE_BASE_API_URL = http://43.137.2.78:8085/server/
VITE_BASE_API_URL = /server/
# base api
VITE_BASE_API = '/server/'

5
.env.production

@ -2,14 +2,15 @@
# @Author: AaronWu 2463371514@qq.com
# @Date: 2025-03-31 15:12:17
# @LastEditors: AaronWu 2463371514@qq.com
# @LastEditTime: 2025-04-02 09:15:19
# @LastEditTime: 2025-07-07 11:52:04
# @FilePath: /IssueSupportManage/.env.production
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 只在生产模式中被载入
# 网站前缀
VITE_BASE_API_URL = http://question.supsub.cn:8085/server/
# VITE_BASE_API_URL = http://question.supsub.cn:8085/server/
VITE_BASE_API_URL = /server/
# base api
VITE_BASE_API = '/server/'

22
vite.config.ts

@ -117,19 +117,19 @@ export default defineConfig({
server: {
host: '0.0.0.0',
port: 8088,
// proxy: {
proxy: {
// http://43.137.2.78:8085/server/question/list
// '/api': {
// target: 'https://nest-api.buqiyuan.site/api/',
// // target: 'http://localhost:7001',
// target: 'http://43.137.2.78:8085',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),
// },
// '/ws-api': {
// target: 'wss://nest-api.buqiyuan.site',
// // target: 'http://localhost:7002',
// changeOrigin: true, //是否允许跨域
// ws: true,
// },
// rewrite: (path) => path.replace(/^\/api/, '/server'),
// },
'/server': {
// target: 'http://43.137.2.78:8085',
target: 'http://192.168.2.64:8089',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/server/, ''),
},
},
},
});

Loading…
Cancel
Save