【VUE 解决跨域问题】 proxyTable

  proxyTable: {
      '/json': {
        target: 'http://kynprodimg.oss-cn-qingdao.aliyuncs.com', //后台接口的服务地址
        changeOrigin: true, //changes the origin of the host header to the target URL 设置是否将host更换为代理url
        ws: true, //websocket是否代理
        secure: false, //true/false, if you want to verify the SSL Certs,https协议的情况下为true
        pathRewrite: { //object/function, rewrite target's url path. Object-keys will be used as RegExp to match paths. 重写url路径
          '^/json': '/json' //需要代理的路径
        }
      }
    },
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
  //BASE_URL: '"http://kyndevimg.oss-cn-qingdao.aliyuncs.com/json/"'
  BASE_URL: '"/json"'
})

 

你可能感兴趣的:(VUE,json)