Browse Source

合并域名修改

master
luyisha 3 years ago
parent
commit
794721f3f0
  1. 1
      public/config.js
  2. 1
      src/config/public.js
  3. 3
      vue.config.js

1
public/config.js

@ -1,4 +1,5 @@
window.publicConfig = { window.publicConfig = {
// 请求地址 // 请求地址
BASE_API:'http://btgym.xingtongworld.com/index.php?s=/api/', BASE_API:'http://btgym.xingtongworld.com/index.php?s=/api/',
// BASE_API:'http://192.168.66.16/index.php?s=/api/',
} }

1
src/config/public.js

@ -2,4 +2,5 @@
window.publicConfig = { window.publicConfig = {
// 请求地址 // 请求地址
BASE_API: 'http://btgym.xingtongworld.com/index.php?s=/api/', BASE_API: 'http://btgym.xingtongworld.com/index.php?s=/api/',
// BASE_API: 'http://192.168.66.16/index.php?s=/api/',
} }

3
vue.config.js

@ -7,7 +7,8 @@ module.exports = defineConfig({
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://btgym.xingtongworld.com/api/', // 配置访问的服务器地址 // target: 'http://btgym.xingtongworld.com/api/', // 配置访问的服务器地址
target: 'http://192.168.66.16/api/', // 配置访问的服务器地址
pathRewrite: { '^/api': '' }, // 用于将请求中的 /api 字符串替换为空, 然后访问地址就能正确访问,若不添加此行配置,那么访问地址就变成了: http://localhost:5000/api/request_url,这样的请求就会出现 404 操作 pathRewrite: { '^/api': '' }, // 用于将请求中的 /api 字符串替换为空, 然后访问地址就能正确访问,若不添加此行配置,那么访问地址就变成了: http://localhost:5000/api/request_url,这样的请求就会出现 404 操作
ws: true, // 是否支持 webstocket, 默认是 true ws: true, // 是否支持 webstocket, 默认是 true
changeOrigin: true // 用于控制请求头中的 host 值, 默认是 ture changeOrigin: true // 用于控制请求头中的 host 值, 默认是 ture

Loading…
Cancel
Save