h5educoderbuild/static/js/main.eb589793.chunk.js

1 line
4.8 KiB
JavaScript

(this.webpackJsonph5=this.webpackJsonph5||[]).push([[1],{101:function(e,n,t){},102:function(e,n,t){},172:function(e,n,t){"use strict";t.r(n);var r=t(0),a=t.n(r),o=t(16),c=t.n(o),i=(t(101),t(102),t(57)),u=t(15),s=t(59),l=t(60),d=t(63),f=t(62),h=function(e){Object(d.a)(t,e);var n=Object(f.a)(t);function t(e){var r;return Object(s.a)(this,t),(r=n.call(this,e)).state={hasError:!1},r}return Object(l.a)(t,[{key:"componentDidCatch",value:function(){}},{key:"render",value:function(){return this.state.hasError?a.a.createElement("h1",null,"Something went wrong."):this.props.children}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),t}(a.a.Component),p=t(58),m=Object(r.lazy)((function(){return Promise.all([t.e(0),t.e(5),t.e(8)]).then(t.bind(null,630))})),v=Object(r.lazy)((function(){return Promise.all([t.e(0),t.e(10)]).then(t.bind(null,628))}));Object(p.b)(),Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),c.a.render(a.a.createElement((function(){return a.a.createElement("div",{className:"app"},a.a.createElement(h,null,a.a.createElement(i.a,{basename:"/h5educoderbuild"},a.a.createElement(r.Suspense,{fallback:a.a.createElement("div",null)},a.a.createElement(u.c,null,a.a.createElement(u.a,{path:"/educodermd/Notice/:courseid/:infromid/:educoder_session/:autologin_trustie",component:v}),a.a.createElement(u.a,{path:"/educodermd/:identifier/:educoder_session/:autologin_trustie",component:m}))))))}),null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){}))},58:function(e,n,t){"use strict";t.d(n,"c",(function(){return v})),t.d(n,"b",(function(){return w})),t.d(n,"a",(function(){return _})),t(93);var r,a=t(19),o=t.n(a),c=t(30),i=t.n(c),u=t(40),s=t(31),l=t.n(s),d=t(32),f=t.n(d),h=t(89),p=t.n(h),m=!1;function v(e){e.map((function(e,n){"educoder_session"===e.id?(l.a.save("_educoder_session",e.value,{path:"/"}),l.a.save("_educoder_session",e.value,{domain:".educoder.net",path:"/"})):(l.a.save("autologin_trustie",e.value,{path:"/"}),l.a.save("autologin_trustie",e.value,{domain:".educoder.net",path:"/"}))}))}function b(e){var n=[function(e){var n=e[1];return"/tasks/".concat(n,"/choose_build.json")}],t=e.url;if(-1!==t.indexOf(".json"))return e;e.withCredentials=!1;var r,a=t.split("?"),o=a[0],c={}[o];return c||[/\/api\/v1\/games\/(\w*)\/choose_build/i].forEach((function(t,i){var u=o.match(t);if(u){var s=n[i];return c=s&&s(u),r="".concat(c,"?").concat(a[1]),e.url=r,e}})),e}function w(){var e="https://data.educoder.net",n={};window.setfalseInRequestMap=function(e){n[e]=!1},f.a.interceptors.request.use(function(){var t=Object(u.a)(i.a.mark((function t(a){var o,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(-1!=a.url.indexOf(e)||-1!=a.url.indexOf(":"))return t.abrupt("return",a);t.next=2;break;case 2:if(b(a),o="/api".concat(a.url),a.params&&null!=a.params.redirect_uri&&-1!=a.params.redirect_uri.indexOf("otherloginqq")&&(o="".concat(a.url)),c=p()("79e33abd4b6588941ab7622aed1e67e8"+r),"true"!="".concat(a[0])&&("3000"===window.location.port?(a.url="".concat(e).concat(o),-1==a.url.indexOf("?")?a.url="".concat(a.url,"?debug=").concat("","&randomcode=").concat(r,"&client_key=").concat(c):a.url="".concat(a.url,"&debug=").concat("","&randomcode=").concat(r,"&client_key=").concat(c)):(a.url=o,-1==a.url.indexOf("?")?a.url="".concat(a.url,"?randomcode=").concat(r,"&client_key=").concat(c):a.url="".concat(a.url,"&randomcode=").concat(r,"&client_key=").concat(c))),"post"!==a.method){t.next=10;break}if(!0===n[a.url])return t.abrupt("return",!1);t.next=10;break;case 10:return-1===a.url.indexOf("update_file")&&(n[a.url]=!0,window.setTimeout("setfalseInRequestMap('"+a.url+"')",900)),t.abrupt("return",a);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),(function(e){return Promise.reject(e)})),f.a.interceptors.response.use((function(e){if(void 0!==e){var t=e.data,r=t.status,a=t.message;if(-1===r)throw window.location.pathname.startsWith("/tasks/"),o.a.info(a||"\u670d\u52a1\u5668\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u3002"),new f.a.Cancel("Operation canceled by the user.");return 403!==r&&"403"!==r||o.a.info("\u8bbf\u95ee\u5f02\u5e38\uff0c\u65e0\u6743\u9650\u3002"),404===r&&o.a.info("\u8bbf\u95ee\u5f02\u5e38\uff0c\u63a5\u53e3404\u3002"),500===r&&o.a.info("\u8bbf\u95ee\u5f02\u5e38\uff0c\u63a5\u53e3500\u3002"),501===r&&(!1===m&&(m=!0,o.a.info(a||"\u8bbf\u95ee\u5f02\u5e38\uff0c\u8bf7\u6c42\u4e0d\u5408\u7406")),window.setTimeout((function(){m=!1}),2e3)),n[e.config.url]=!1,e}}))}window._debugType="";var _=0<location.href.indexOf("test-")||0<location.href.indexOf("localhost")?"https://test-newweb.educoder.net":"https://www.educoder.net"},96:function(e,n,t){e.exports=t(172)}},[[96,2,4]]]);