First about cross-domain What is https://baike.baidu.com/item/...
The Pagoda Linux panel is a server panel that is relatively friendly to novices, but it cannot avoid some common server problems such as cross-domain problems:
Website》Select Website》Configuration File
Solution
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
Go to this page and paste the above code at the bottom, and then restart the server
Here is a json data of prepared music that can be tested
http://101.200.141.4/api/musi...
juqery: $.ajax({ type: "get", url: "http://101.200.141.4/api/music.json", success: function (response) { console.log(response.name); console.table(response.data); } }); 在vue中可以安装vue-axios进行请求