[Vuejs] Vue解决代理设置导致浏览器Session丢失的问题

以下是会造成Session丢失的代理:

proxyTable: {
      '/proxyApi': {
        target: 'http://111.18.149.215:8080/WRSOCXSystem/html/',
        changeOrigin: true,
        pathRewrite: {
          '^/proxyApi': '/'
        }
      }
    },

修改成:

proxyTable: {
      '/WRSOCXSystem': {
        target: 'http://111.18.149.215:8080/WRSOCXSystem/html/',
        changeOrigin: true,
        pathRewrite: {
          '^/WRSOCXSystem': '/'
        }
      }
    },

需要把代理名称  proxyApi 替换成后台请求根目录 WRSOCXSystem 即可

posted on 2019-05-23 22:24  晏过留痕  阅读(3714)  评论(0编辑  收藏  举报