window.location.hostname and localhost, cross-domain access (CORS)

local area network

The machine opens a local website http: //10.10.xx.xx: xxxx /, available at this page http: // localhost: the emergence of cross-border visits when xxxx / (the same port number) in response to the state's problems

 

Solution: http: // localhost: xxxx == "http: //'+window.location.hostname+ ': xxxx (sets or returns the current URL's hostname)

====> response status codes 200   

Guess you like

Origin www.cnblogs.com/muyi-one/p/11391096.html