Nuxt.js project request cross-domain

in the website built by nuxt.js, a request is sent in the asyncData method on the home page. The interface address is forwarded with nginx. The background log checks the returned data, but the front end does not receive the returned data. The website cannot be opened
call the console to report an error before the component is loaded

configure in nginx

clipboard.png

clipboard.png
seek the solution

Mar.14,2021

    Don't requests in
  1. asyncData be sent once during server ssr? this time there is no cross-domain problem.
  2. the prompt you see in the browser console should be that the server data request failed, resulting in no client retransmission caused by _ _ INITIAL_STATE__ , and cross-domain error.
  3. the error message you didn't intercept in the second paragraph should be only one allowed . Is there any other place in nginx where Access-Control-Allow-Origin is set? is it set twice? Or the response head is not set correctly.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb015-311c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb015-311c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?