index-legacy.ec32ced6.js 13 KB

1
  1. !function(){function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function n(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void n(s)}u.done?e(c):Promise.resolve(c).then(r,o)}function r(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))}}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=document.createElement("style");u.innerHTML="._error_t671u_1{background-color:#fff;display:flex;flex-direction:column;min-height:100vh;align-items:center;justify-content:center}._error_t671u_1 ._info_t671u_9{display:flex;align-items:center;margin-bottom:.8rem}._error_t671u_1 ._info_t671u_9 span{display:inline-block;margin-left:.26667rem;color:#58727e;font-size:.48rem}._error_t671u_1 .col-result-container,._error_t671u_1 .van-empty{padding-top:0}._error_t671u_1 .van-button{width:50%}._login_t671u_27{min-height:100vh;background-color:#f6f6f6;background-size:100%;position:relative;overflow:hidden}._login_t671u_27 ._loginCenter_t671u_34{margin:0 auto;text-align:center}._login_t671u_27 ._userInfo_t671u_38{margin-top:1.92rem}._login_t671u_27 ._userInfo_t671u_38 ._img_t671u_41{width:2.77333rem;height:2.77333rem;border-radius:50%;overflow:hidden}._login_t671u_27 ._userInfo_t671u_38 ._name_t671u_47{padding-top:.32rem;font-size:.53333rem;font-weight:500;color:#333;line-height:.74667rem}._login_t671u_27 ._tips_t671u_54{padding-top:1.33333rem}._login_t671u_27 ._tips_t671u_54 ._logo_t671u_57{height:.74667rem}._login_t671u_27 ._tips_t671u_54 ._text_t671u_60{padding-top:.32rem;font-size:.37333rem;color:#777;line-height:.53333rem}._login_t671u_27 ._tips_t671u_54 ._phone_t671u_66{padding-top:.64rem;font-size:.53333rem;font-weight:500;color:#333;line-height:.74667rem}._login_t671u_27 ._btnGroup_t671u_73{position:absolute;bottom:1.86667rem;width:100%;text-align:center;display:flex;align-items:center;flex-direction:column}._login_t671u_27 ._btnGroup_t671u_73 ._btn_t671u_73{font-size:.42667rem;font-weight:500;width:5.44rem}._login_t671u_27 ._btnGroup_t671u_73 ._moreBtn_t671u_87{padding-top:.64rem;font-size:.42667rem;color:#333;line-height:.58667rem}\n",document.head.appendChild(u),System.register(["./index-legacy.fba2875c.js","./auth-legacy.0b00e81c.js","./routes-common-legacy.6845df4a.js"],(function(e,n){"use strict";var o,a,u,c,s,l,m,p,f,h,d,_,g,v,y,b,j,w,x,k,A,I,O,T,E,S,R,C,P,z,D;return{setters:[function(t){o=t.d,a=t._,u=t.r,c=t.c,s=t.o,l=t.e,m=t.T,p=t.s,f=t.a,h=t.b,d=t.f,_=t.g,g=t.h,v=t.p,y=t.i,b=t.j,j=t.C,w=t.R,x=t.F,k=t.k,A=t.l,I=t.m,O=t.D,T=t.n,E=t.q,S=t.t,R=t.u,C=t.v},function(t){P=t.A},function(t){z=t.r,D=t.a}],execute:function(){var $=o({name:"App"});var q,U=a($,[["render",function(t,e,n,r,o,i){var a=u("router-view");return s(),c(a)}]]),G=e("b",{error:"_error_t671u_1",info:"_info_t671u_9",login:"_login_t671u_27",loginCenter:"_loginCenter_t671u_34",userInfo:"_userInfo_t671u_38",img:"_img_t671u_41",name:"_name_t671u_47",tips:"_tips_t671u_54",logo:"_logo_t671u_57",text:"_text_t671u_60",phone:"_phone_t671u_66",btnGroup:"_btnGroup_t671u_73",btn:"_btn_t671u_73",moreBtn:"_moreBtn_t671u_87"}),H=(e("r",(function(){sessionStorage.removeItem("Authorization")})),e("s",(function(t){sessionStorage.setItem("Authorization",t)}))),L=e("a",l({timeout:2e4,timeoutMessage:"请求超时"})),N=!1;L.interceptors.request.use((function(t,e){e.hideLoading||(clearTimeout(q),m.loading({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0})),N=e.initRequest||!1;var n=sessionStorage.getItem("Authorization")||"",r={};return n&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(t)&&(r.Authorization=n),{url:t,options:i(i({},e),{},{params:p(e.params),headers:i(i({},e.headers),r)})}}),{global:!1}),L.interceptors.response.use(function(){var t=r(regeneratorRuntime.mark((function t(e){var n,r,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(q=setTimeout((function(){m.clear()}),100),!(e.status>299||e.status<200)){t.next=6;break}throw clearTimeout(q),n="服务器错误,状态码"+e.status,m(n),new Error(n);case 6:return t.next=8,e.clone().json();case 8:if(200===(r=t.sent).code||0===r.errCode){t.next=16;break}throw o=r.msg||r.message||"处理失败,请重试",N&&(403===r.code||401===r.code?f():h()),403!==r.code&&401!==r.code&&(clearTimeout(q),m(o)),d(),403===r.code&&(o+="403",f(),window.location.href=window.location.origin+window.location.pathname+"#/home-layout-center"),new Error(o);case 16:return t.abrupt("return",e);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),{global:!1});var B=d(),F=o({name:"Auth-loayout",data:function(){return{loading:!1}},computed:{isExternal:function(){return this.$route.meta.isExternal&&!B.isStudent||!1},isNeedView:function(){return"login"===_.user.status||"/home-auth"===this.$route.path||"/home-login"===this.$route.path||"/home-layout-center"===this.$route.path||this.isExternal}},mounted:function(){!this.isExternal&&this.setAuth(),_.orchestraInfo.unionId||g()},methods:{setAuth:function(){var t=this;return r(regeneratorRuntime.mark((function e(){var n,r,o,a,u,c,s,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.$route.query,(r=n.userInfo||n.Authorization)&&H(r),!t.loading){e.next=5;break}return e.abrupt("return");case 5:if("init"!==_.user.status&&"error"!==_.user.status){e.next=26;break}if(t.loading=!0,e.prev=7,!_.orchestraInfo.unionId){e.next=15;break}return e.next=11,L.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:_.orchestraInfo.phone,token:_.orchestraInfo.token,isSurportRegister:!0}});case 11:o=e.sent,a=o.data.authentication,H(a.token_type+" "+a.access_token),v({api:"setCache",content:{key:"h5-colexiu-token",value:a.token_type+" "+a.access_token}});case 15:return e.next=17,L.get("/api-student/student/queryUserInfo",{initRequest:!0,requestType:"form"});case 17:u=e.sent,y(u.data),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(7),-1===(c=e.t0.message).indexOf("5000")&&-1===c.indexOf("authentication")?h():f();case 25:t.loading=!1;case 26:if("logout"===_.user.status)try{s=t.$route,l=i({returnUrl:t.$route.path},t.$route.query),s.meta.isRegister&&(l.isRegister=s.meta.isRegister),t.$router.replace({path:"/home-auth",query:l})}catch(m){}case 27:case"end":return e.stop()}}),e,null,[[7,21]])})))()}},render:function(){return b(x,null,["error"===_.user.status?b("div",{class:G.error},[b(j,{type:"notFond",classImgSize:"CERT",tips:"加载失败,请稍后重试",buttonText:"重新加载",plain:!0,onClick:this.setAuth},null)]):this.isNeedView?b(w,null,null):null])}}),M=[{path:"/share-music-sheet",name:"share-music-sheet",component:function(){return k((function(){return n.import("./index-legacy.1bab11bd.js")}),void 0)},meta:{title:"分享乐曲"}},{path:"/leaderboard",component:function(){return k((function(){return n.import("./index-legacy.008d0bb7.js")}),void 0)},meta:{title:"曲目挑战排行榜"}}],V=[{path:"/",component:P,children:[].concat(t(z),[{path:"/login",name:"login",component:function(){return k((function(){return n.import("./login-legacy.5cf33a59.js")}),void 0)},meta:{isRegister:!1}},{path:"/practiceClass",name:"practiceClass",component:function(){return k((function(){return n.import("./index-legacy.3dbf0967.js")}),void 0)},meta:{title:"陪练课"}},{path:"/videoDetail",name:"videoDetail",component:function(){return k((function(){return n.import("./video-detail-legacy.cdcf9311.js")}),void 0)},meta:{title:"视频课"}},{path:"/videoClassDetail",name:"videoClassDetail",component:function(){return k((function(){return n.import("./video-class-detail-legacy.42a78724.js")}),void 0)},meta:{title:"视频课详情"}},{path:"/liveDetail",name:"liveDetail",component:function(){return k((function(){return n.import("./live-detail-legacy.3122eb67.js")}),void 0)},meta:{title:"直播课详情"}},{path:"/memberActive",name:"memberActive",component:function(){return k((function(){return n.import("./member-active-legacy.1d8ff695.js")}),void 0)},meta:{title:"小酷Ai会员大放价"}},{path:"/memberRecord",name:"memberRecord",component:function(){return k((function(){return n.import("./member-record-legacy.48e6f0d6.js")}),void 0)},meta:{title:"训练统计"}},{path:"/tradeRecord",name:"tradeRecord",component:function(){return k((function(){return n.import("./index-legacy.56bd01be.js")}),void 0)},meta:{title:"交易记录"}},{path:"/teacherHome",name:"teacherHome",component:function(){return k((function(){return n.import("./teacher-home-legacy.2b339b78.js")}),void 0)},meta:{title:"老师主页"}},{path:"/teacherElegant",name:"teacherElegant",component:function(){return k((function(){return n.import("./teacher-elegant-legacy.2fe4fede.js")}),void 0)},meta:{title:"老师风采"}},{path:"/music-upload",component:function(){return k((function(){return n.import("./index-legacy.f862f139.js")}),void 0)},meta:{title:"上传曲谱"}},{path:"/teacherFollow",component:function(){return k((function(){return n.import("./teacher-follow-legacy.f12c01a8.js")}),void 0)},meta:{title:"我的关注"}},{path:"/track-review-activity",component:function(){return k((function(){return n.import("./index-legacy.076c94de.js")}),void 0)},meta:{title:"曲目评测活动",isExternal:!0}},{path:"/track-song",component:function(){return k((function(){return n.import("./track-song-legacy.bd3cd22e.js")}),void 0)},meta:{title:"评测曲目"}}])},{path:"/home-layout",component:F,children:[{path:"/home-auth",name:"home-auth",component:function(){return k((function(){return n.import("./auth-login-legacy.4d775b67.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-layout-center",name:"home-layout-center",component:function(){return k((function(){return n.import("./home-layout-center-legacy.b995f4a2.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home-login",name:"home-login",component:function(){return k((function(){return n.import("./login-legacy.a12a26c3.js")}),void 0)},meta:{title:"登录酷乐秀"}},{path:"/home",name:"home",component:function(){return k((function(){return n.import("./index-legacy.7dec9806.js")}),void 0)}}]}].concat(M,t(D),[{path:"/inviteTeacher",name:"inviteTeacher",component:function(){return k((function(){return n.import("./index-legacy.95503654.js")}),void 0)},meta:{title:"邀请学员"}},{path:"/inviteSuccess",name:"inviteSuccess",component:function(){return k((function(){return n.import("./index-legacy.3a476b82.js")}),void 0)},meta:{title:"注册成功"}},{path:"/transfer",component:function(){return k((function(){return n.import("./transfer-legacy.aa5f67ba.js")}),void 0)},meta:{title:"酷乐秀学院"}},{path:"/download",component:function(){return k((function(){return n.import("./download-legacy.3c0ba2ba.js")}),void 0)}},{path:"/:pathMatch(.*)*",component:function(){return k((function(){return n.import("./index-legacy.89eca94e.js")}),void 0)},meta:{title:"404 Not Fund",platform:"STUDENT"}}]),J=A({history:I(),routes:V});J.beforeEach((function(t,e,n){var r=t.meta.title;document.title=r||"酷乐秀",n()}));var K=!1;J.onError((function(t){if(t instanceof Error){var e=t.name.indexOf("chunk"),n=J.currentRoute.value.fullPath;e&&!K&&(K=!0,O.alert({title:"更新提示",message:"APP有更新请点击确定刷新页面?",confirmButtonColor:"var(--van-primary)"}).then((function(){d().isApp?T({api:"back"}):(location.hash=n,window.location.reload())})))}}));var Q=E(U);T({api:"getVersion"},(function(t){_.version=t.content.version})),d().isOrchestraStudent&&(v({api:"getUserAccount"}).then((function(t){var e=t.content;_.orchestraInfo.token=e.token.split(" ")[1],_.orchestraInfo.phone=e.phone,_.orchestraInfo.nickname=e.nickname,_.orchestraInfo.avatar=e.avatar,_.orchestraInfo.unionId=e.unionId||0})),v({api:"getCache",content:{key:"h5-colexiu-token"}}).then((function(t){var e=t.content;e.value&&S(e.value)}))),d().isTeacher?_.platformType="TEACHER":(d().isStudent,_.platformType="STUDENT"),"TEACHER"===_.platformType?_.platformApi="/api-teacher":_.platformApi="/api-student",R.locale("zh-ch"),Q.config.globalProperties.$dayjs=R,Q.config.globalProperties.$filters=C,Q.use(J),Q.mount("#app")}}}))}();