How to understand cross-domain?

Cross-domain is a secure display imposed by browsers, that is, websites of different sources cannot ask the content of other sites.
but I have a local vue project, why can I use axios to access Douban"s api directly?

https://m.douban.com/rexxar/api/v2/muzzy/columns/10018/items?start=0&count=3

isn"t this access cross-domain?


Cross-domain, which means http (s): / / host:port . As long as this string is inconsistent with the current website, the browser will think that you have crossed a domain.
for example, if you initiate a POST request, if the request is not cross-domain, the post request will be launched directly.
however, if you meet the cross-domain condition, you will be restricted. The specific execution of
is as follows:
first initiates a OPTIONS request to the cross-domain target server,
if the status code 200 is returned, and the request header Access-Control-Allow-Origin is returned;
if it contains your domain name (usually * , representing all websites), the browser considers it legal and initiates the target request POST again, which is successful, otherwise the error cannot be accessed across domains.


1. Different protocols
2. Domain names are different
3. Different ports
one of the three conditions meets can cause cross-domain
this api interface should be open to the server to allow cross-domain


1. First, let's see if your request header is:
Xmuri RequestedWisthWith: XMLHttpRequest
this indicates that it is a XHR request before cross-domain issues are involved

.

2. It may be that the server has enabled allowing cross-domain


header ("Access-Control-Allow-Origin: *"). If this is added to the other party's interface, it will allow you to access it, and it may also be a public interface, so he will directly open permissions


Douban API has an Allow-Request-Origin header, allowing cross-domain access.
how can you play if you are not allowed to cross-domain when you do API?

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-7b493b-1e9ee.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-7b493b-1e9ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?