If the backend interface is set to restrict domain name access, can I request data by pretending to be the other party's domain name or IP through node or ajax?
You can configure a reverse proxy through niginx to solve cross-domain problems
In this case, ajax’s jsonp will not work. You can forward it through node middleware
middleware: [ // 请求代理,按需设置 proxy('/api', { target: 'http://op.juhe.cn', // 目标地址 changeOrigin: true, ws: true, //websocket pathRewrite: { '^/api': '' //重写地址 } }) ]
You can configure a reverse proxy through niginx to solve cross-domain problems
In this case, ajax’s jsonp will not work. You can forward it through node middleware