You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
9.8 KiB
1 line
9.8 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[129],{"5oB3":function(t,e,r){t.exports={flex_box_center:"flex_box_center___2WENa",flex_space_between:"flex_space_between___32o_C",flex_box_vertical_center:"flex_box_vertical_center___VReNJ",flex_box_center_end:"flex_box_center_end___VidHP",flex_box_column:"flex_box_column___7bh0_",guidance:"guidance___1zlCK",title:"title___TLK56",u:"u___1YcNG",active:"active___2cPfY",content:"content___3PW9_",btn:"btn___26Rnl"}},ObO0:function(t,e,r){"use strict";r.r(e);r("cWXX");var n=r("/ezw"),o=(r("+L6B"),r("2/Rp")),a=r("9og8"),i=r("tJVT"),c=r("PpiC"),u=r("q1tI"),l=r.n(u),s=r("Ty5D"),f=r("9kvl"),h=r("1vsH"),v=r("5oB3"),p=r.n(v),d=r("ErOA"),y=r("m3rI"),_=r("9Bee");function m(){m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof _?e:_,i=Object.create(a.prototype),c=new G(n||[]);return o(i,"_invoke",{value:N(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",v="suspendedYield",p="executing",d="completed",y={};function _(){}function g(){}function b(){}var w={};l(w,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(I([])));E&&E!==r&&n.call(E,i)&&(w=E);var O=b.prototype=_.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function N(e,r,n){var o=h;return function(a,i){if(o===p)throw new Error("Generator is already running");if(o===d){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:v,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},j(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new L(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),l(O,u,"Generator"),l(O,i,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}var g=function(t){var e,r,f,v=t.user,g=(Object(c["a"])(t,["user"]),Object(u["useState"])(1)),b=Object(i["a"])(g,2),w=b[0],x=b[1],E=Object(u["useState"])(!1),O=Object(i["a"])(E,2),j=O[0],L=O[1],N=Object(u["useState"])(!1),k=Object(i["a"])(N,2),S=k[0],P=k[1],G=Object(u["useState"])(""),I=Object(i["a"])(G,2),T=I[0],z=I[1],C=Object(u["useState"])(!0),F=Object(i["a"])(C,2),R=F[0],A=F[1],B=Object(u["useState"])([{},{}]),J=Object(i["a"])(B,2),V=J[0],Y=J[1],W=Object(s["l"])(),H=W.pathname;console.log(W,"location"),Object(u["useEffect"])((function(){var t;(null===v||void 0===v||null===(t=v.userInfo)||void 0===t?void 0:t.identity)&&K()}),[null===v||void 0===v||null===(e=v.userInfo)||void 0===e?void 0:e.identity]),Object(u["useEffect"])((function(){X()}),[]);var K=function(){var t;H.includes("classrooms")?"student"===(null===v||void 0===v||null===(t=v.userInfo)||void 0===t?void 0:t.identity)&&(L(!0),x(2)):H.includes("paths")&&P(!0)},X=function(){var t=Object(a["a"])(m().mark((function t(e){var r,n,o,a;return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["a"])("/api/introductions.json",{method:"get"});case 2:r=t.sent,(null===r||void 0===r?void 0:r.introductions)&&(n=null,H.includes("classrooms")&&(n="course",z("\u6559\u5b66\u8bfe\u5802")),H.includes("paths")&&(n="subject",z("\u5b9e\u8df5\u8bfe\u7a0b")),o=r.introductions,a=[null===o||void 0===o?void 0:o.find((function(t){return"teacher"===t.clazz&&t.page_type===n})),null===o||void 0===o?void 0:o.find((function(t){return"student"===t.clazz&&t.page_type===n}))],Y(a)),A(!1);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function(){var t,e,r=y["a"].API_SERVER+"/api/attachments/"+(1===w?null===(t=V[0])||void 0===t?void 0:t.attachment_id:null===(e=V[1])||void 0===e?void 0:e.attachment_id);Object(h["s"])("",r)};return l.a.createElement("section",{className:p.a.guidance},l.a.createElement(n["a"],{loading:R,active:!0,paragraph:{rows:5}},l.a.createElement("div",{className:p.a.title},T,"\u65b0\u624b\u6307\u5f15"),l.a.createElement("ul",{className:p.a.u},!j&&l.a.createElement("li",{onClick:function(){return x(1)},className:1===w?p.a.active:""},"\u6559\u5e08\u7248"),!S&&l.a.createElement("li",{onClick:function(){return x(2)},className:2===w?p.a.active:""},"\u5b66\u751f\u7248")),1===w&&l.a.createElement("div",{className:p.a.content},l.a.createElement(_["a"],{value:(null===(r=V[0])||void 0===r?void 0:r.content)||""})),2===w&&l.a.createElement("div",{className:p.a.content},l.a.createElement(_["a"],{value:(null===(f=V[1])||void 0===f?void 0:f.content)||""})),l.a.createElement("div",{className:p.a.btn},l.a.createElement(o["a"],{type:"primary",onClick:q},"\u4e0b\u8f7d\u7528\u6237\u624b\u518c"))))};e["default"]=Object(f["a"])((function(t){var e=t.user;return{user:e}}))(g)}}]); |