Commit c9ecd9a7 authored by Li Mingzhe's avatar Li Mingzhe

feat: test

parent d5dbb507
...@@ -1134,7 +1134,7 @@ cc.Class({ ...@@ -1134,7 +1134,7 @@ cc.Class({
sendData(id, data) { sendData(id, data) {
// localStorage.setItem(id, JSON.stringify(data)); // localStorage.setItem(id, JSON.stringify(data));
http('GET', 'http://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid='+this.courseid, data).then((resStr) => { http('POST', 'http://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid='+this.courseid, data).then((resStr) => {
const res = JSON.parse(resStr) const res = JSON.parse(resStr)
console.log('res: ', res); console.log('res: ', res);
}); });
......
...@@ -176,7 +176,7 @@ export async function http(type, url, data) { ...@@ -176,7 +176,7 @@ export async function http(type, url, data) {
} }
}; };
xhr.open(type, url, true); xhr.open(type, url, true);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); // xhr.setRequestHeader("Content-Type","application/json; charset=utf-8");
xhr.send(data); xhr.send(JSON.stringify(data));
}); });
} }
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