2017-10-19 113 views

回答

0

您可以嘗試調整的WebPack-DEV-服務器代理對象pathRewrite財產

devServer: { 
    contentBase: <Your-Value>, 
    proxy = { 
     '/test/menuList': { 
      target: http://localhost:9000/test/menuList, 
      pathRewrite(req, options) { 
        return req + '.json'; 
      } 
     } 
    } 
    ... 
}