diff --git a/src/index.html b/src/index.html index b77274e92ddffbd8103ae2b3f181ef27f6e95ba9..f5e02f13e1b1204349383ade9da0f3364a8c2ad2 100644 --- a/src/index.html +++ b/src/index.html @@ -7,80 +7,9 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> + <script type="text/javascript" src="http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script> - <script> - - window.courseware = (function(){ - if(window.parent.net){ - window.net = window.parent.net; - var id = window.frameElement.getAttribute("dataid"); - return { - getData: function(callback, key=''){ - net.getData("getCoursewareData",id,function(res){ - if(res){ - res = JSON.parse(res); - if(res.msg==="success"){ - let callData = null; - if(res.data&&res.data!='null'){ - callData = JSON.parse(res.data); - } - callback&&callback(callData); - }else{ - alert('æ•°æ®åŠ è½½å¤±è´¥ï¼'); - } - }else{ - alert('æ•°æ®åŠ è½½å¤±è´¥ï¼'); - } - }); - }, - setData: function(data,callback, key=''){ - let str = JSON.stringify(data); - net.getData("setCoursewareData",{id: id,data: str},function(res){ - if(res){ - res = JSON.parse(res); - if(res.msg==="success"){ - callback&&callback(); - }else{ - alert('æ•°æ®ä¿å˜å¤±è´¥ï¼'); - } - }else{ - alert('æ•°æ®ä¿å˜å¤±è´¥ï¼'); - } - }); - }, - uploadUrl: function(){ - return net.getUploadFileURL(); - }, - uploadData: function(){ - return net.getAjaxData("uploadFile",""); - } - } - } else { - return { - getData: function(callback, key=''){ - let data = localStorage.getItem("courseware_data_" + key); - if(data){ - data = JSON.parse(data); - } - callback&&callback(data); - }, - setData: function(data,callback, key=''){ - console.log("******local********"); - localStorage.setItem("courseware_data_" + key,JSON.stringify(data)); - callback&&callback(); - }, - uploadUrl: function(){ - return 'http://localhost:3000/api/test'; - }, - uploadData: function(){ - return {}; - } - } - } - })(); - - - </script> + </head> <body> <app-root></app-root>