Commit 6882f309 authored by 范雪寒's avatar 范雪寒

feat:

parent c94a9227
...@@ -53,7 +53,6 @@ cc.Class({ ...@@ -53,7 +53,6 @@ cc.Class({
} }
queryStr += params.join("&"); queryStr += params.join("&");
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
xhr.setRequestHeader('Access-Control-Allow-Private-Network', true);
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) { if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
callBack(xhr.responseText); callBack(xhr.responseText);
...@@ -62,6 +61,7 @@ cc.Class({ ...@@ -62,6 +61,7 @@ cc.Class({
const url = `${baseUrl}${uri}${queryStr}`; const url = `${baseUrl}${uri}${queryStr}`;
console.log('url = ' + url); console.log('url = ' + url);
xhr.open('GET', url, true); xhr.open('GET', url, true);
xhr.setRequestHeader('Access-Control-Allow-Private-Network', true);
xhr.send(); xhr.send();
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment