![]() | 1 lairdnote 2017-12-20 10:14:40 +08:00 自己写一个 post 的接口 转 get 就 ok 了。。代理一下 |
![]() | 3 loy6491 2017-12-20 14:09:32 +08:00 ![]() onProxyReq: function(reqProxy, req, res) { reqProxy.method = 'GET'; } |
![]() | 4 SourceMan 2017-12-20 14:23:18 +08:00 如三楼所说,request 拦截器拦下了修改 method 再 return 回去发请求。 |
![]() | 6 nuxt OP @SourceMan 具体怎么写 ``` proxyTable: { '/withDrawals': { filter: function (path, req) { return req.method === 'POST' }, onProxyReq: function(reqProxy, req, res) { reqProxy.method = 'GET' return reqProxy }, target: '/withDrawals' }, '/rechargeMoney': { filter: function (path, req) { return req.method === 'POST' }, onProxyReq: function(reqProxy, req, res) { reqProxy.method = 'GET' return reqProxy }, target: '/rechargeMoney' } }, ``` |