構(gòu)建Web的API訪問(wèn)路徑URL+Port
const origin = window.location.origin;
const protocol = window.location.protocol;
const hostname = window.location.hostname;
const port = 80;
const API_ROOT = protocol + "http://" + hostname + ":" + port;
API_ROOT即為API的訪問(wèn)路徑