Commit c9ecd9a7 authored by Li Mingzhe's avatar Li Mingzhe

feat: test

parent d5dbb507
......@@ -1134,7 +1134,7 @@ cc.Class({
sendData(id, 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)
console.log('res: ', res);
});
......
......@@ -176,7 +176,7 @@ export async function http(type, url, data) {
}
};
xhr.open(type, url, true);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
xhr.send(data);
// xhr.setRequestHeader("Content-Type","application/json; charset=utf-8");
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