want to call an API across domains. According to the official document, the configuration in nuxt.config.js is as follows:
function shouldProxy (context, req) {
var path = (req.originalUrl || req.url)
console.log("shouldProxy path:", context, path);// :shouldProxy path: /api/douban /admin/tag
return contextMatcher.match(context, path, req)
}
indicates that the configuration has been initialized correctly. The problem is that this log is available only when the page is refreshed for server rendering. In this case, the path is a page route rather than an api request, but the request on the page is not proxied.
is very strange. I don"t know what is wrong with the configuration. Please help me.