Cross-domain problems after the launch of the vue project

problem description

vue2 imitates QQ Music project. After being packaged and launched, the agent has cross-domain problems, and some data cannot be requested

the environmental background of the problems and what methods you have tried

the server side is the nginx environment, and there are a lot of references on the Internet, but it still hasn"t been solved

.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

the pagoda panel nginx agent configuration information
clipboard.png


clipboard.png


clipboard.png

before

clipboard.png

is shown in the picture.

what result do you expect? What is the error message actually seen?

how to match the server-side nginx, please help me

Feb.07,2022

refer to the profile portrait of Wechat, the agent

location ^~ /wechat_avatar/ {
    add_header 'Access-Control-Allow-Origin' "$http_origin" always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-   Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
    proxy_pass http://thirdwx.qlogo.cn/;
}
Menu