|
@@ -288,14 +288,25 @@ export default class Scene extends cc.Component {
|
|
|
this.addPrefab(curUint, curPage + 1);
|
|
|
}
|
|
|
else{
|
|
|
+ let funcSB = (req, right)=>{
|
|
|
+ common.log('上报 ', right, ' : ', JSON.stringify(req));
|
|
|
+ // 返回课程详情页
|
|
|
+ window.location.href = common.urlClass;
|
|
|
+ };
|
|
|
let token = Tools.getLocalStorage('token', null);
|
|
|
let xhr = new XMLHttpRequest();
|
|
|
- xhr.open("GET", common.urlOver, true);
|
|
|
- xhr.setRequestHeader('itemId', common.getItemId());
|
|
|
+ xhr.open("GET", common.urlOver + common.getItemId(), true);
|
|
|
xhr.setRequestHeader('token', token);
|
|
|
+ xhr.onreadystatechange = function () {
|
|
|
+ if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) {
|
|
|
+ funcSB(xhr, true);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ xhr.onerror = function () {
|
|
|
+ funcSB(xhr, false);
|
|
|
+ }
|
|
|
xhr.send();
|
|
|
- // 返回课程详情页
|
|
|
- window.location.href = common.urlClass;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|