!function(){var e=["returnUrl","isRegister"];function n(e,n,t,r,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void t(c)}s.done?n(u):Promise.resolve(u).then(r,o)}function t(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,u,"next",e)}function u(e){n(a,o,i,s,u,"throw",e)}s(void 0)}))}}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=document.createElement("style");s.innerHTML="._login_18sy9_1{min-height:100vh;background:url(./assets/top_bg.e8f7f58b.png) no-repeat top center,url(./assets/bottom_bg.2d0f4251.png) no-repeat bottom center;background-color:#fff;background-size:100%}._login_18sy9_1 ._loginTitle_18sy9_7{padding-top:2.66667rem;font-size:.69333rem;padding-left:.93333rem;padding-bottom:1.86667rem;line-height:.98667rem;font-weight:500}._login_18sy9_1 ._codeText_18sy9_15{color:var(--van-primary)}._login_18sy9_1 ._margin34_18sy9_18{margin:0 .90667rem}._login_18sy9_1 ._formTitle_18sy9_21{font-size:.48rem;color:#000;font-weight:500}._login_18sy9_1 .van-cell-group{margin-bottom:.93333rem}._login_18sy9_1 .van-field{padding-left:0;padding-right:0}._login_18sy9_1 .van-button+.van-button{margin-top:.53333rem;color:#000!important}\n",document.head.appendChild(s),System.register(["./index-legacy.fba2875c.js","./index-legacy.f231f1c5.js","./index-legacy.7dcec7b3.js","./index-legacy.8921f068.js","./index-legacy.168f0d2b.js","./index-legacy.fc77fe4f.js","./validate-legacy.c1df5f0e.js","./use-id-legacy.db87b112.js","./index-legacy.d92f7da7.js"],(function(n){"use strict";var r,i,s,u,c,l,d,f,p,m,g,h,y,b,_,v,w;return{setters:[function(e){r=e.d,i=e.h,s=e.g,u=e.w,c=e.t,l=e.i,d=e.T,f=e.j,p=e.z,m=e.B},function(e){g=e.C},function(){},function(e){h=e.F},function(e){y=e.C,b=e.I},function(e){_=e.R,v=e.C},function(e){w=e.c},function(){},function(){}],execute:function(){var x="_login_18sy9_1",S="_loginTitle_18sy9_7",C="_codeText_18sy9_15",j="_margin34_18sy9_18",O="_formTitle_18sy9_21";n("default",r({name:"login",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,countDownRef:null,imgCodeStatus:!1}},computed:{codeDisable:function(){var e=!0;return"PWD"===this.loginType?this.username&&this.password&&(e=!1):this.username&&this.smsCode&&(e=!1),e}},mounted:function(){i(),this.directNext()},methods:{directNext:function(){if("login"===s.user.status||"error"===s.user.status){var n=this.$route.query,t=n.returnUrl,r=(n.isRegister,a(n,e));this.$router.replace({path:t,query:o({},r)})}},onLogin:function(){var e=this;return t(regeneratorRuntime.mark((function n(){var t,r,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"PWD"!==e.loginType){n.next=7;break}return n.next=4,u.post("/api-auth/usernameLogin",{requestType:"form",data:{username:e.username,password:e.password,clientId:"teacher",clientSecret:"teacher"}});case 4:t=n.sent,n.next=10;break;case 7:return n.next=9,u.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"teacher",clientSecret:"teacher",phone:e.username,smsCode:e.smsCode}});case 9:t=n.sent;case 10:return r=t.data.authentication,c(r.token_type+" "+r.access_token),n.next=14,u.get("/api-teacher/teacher/queryUserInfo",{initRequest:!0});case 14:o=n.sent,l(o.data),e.directNext(),n.next=21;break;case 19:n.prev=19,n.t0=n.catch(0);case 21:case"end":return n.stop()}}),n,null,[[0,19]])})))()},onSendCode:function(){var e=this;return t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(w(e.username)){n.next=2;break}return n.abrupt("return",d("请输入正确的手机号码"));case 2:e.imgCodeStatus=!0;case 3:case"end":return n.stop()}}),n)})))()},onCodeSend:function(){this.countDownStatus=!1,this.countDownRef.start()},onFinished:function(){this.countDownStatus=!0,this.countDownRef.reset()},onChange:function(){"PWD"===this.loginType?this.loginType="SMS":"SMS"===this.loginType&&(this.loginType="PWD")}},render:function(){var e=this;return f("div",{class:x},[f("div",{class:S},[p("您好,"),f("br",null,null),p(" 欢迎使用酷乐秀")]),f(g,{class:j,border:!1},{default:function(){return[f(_,{style:{marginBottom:"16px"}},{default:function(){return[f(v,{span:24,class:O},{default:function(){return[p("手机号")]}}),f(v,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(h,{modelValue:e.username,"onUpdate:modelValue":function(n){return e.username=n},name:"手机号",placeholder:"请输入您的手机号",type:"tel",maxlength:11},null)]}})]}}),"PWD"===e.loginType?f(_,null,{default:function(){return[f(v,{span:24,class:O},{default:function(){return[p("密码")]}}),f(v,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(h,{modelValue:e.password,"onUpdate:modelValue":function(n){return e.password=n},type:"password",name:"密码",placeholder:"请输入密码"},null)]}})]}}):f(_,null,{default:function(){return[f(v,{span:24,class:O},{default:function(){return[p("验证码")]}}),f(v,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(h,{modelValue:e.smsCode,"onUpdate:modelValue":function(n){return e.smsCode=n},name:"验证码",placeholder:"请输入验证码",type:"tel",maxlength:6},{button:function(){return e.countDownStatus?f("span",{class:C,onClick:e.onSendCode},[p("获取验证码")]):f(y,{ref:e.countDownRef,"auto-start":!1,time:e.countDownTime,onFinish:e.onFinished,format:"ss秒"},null)}})]}})]}})]}}),f("div",{class:j},[f(m,{round:!0,block:!0,type:"primary",disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[p("提交")]}}),f(m,{block:!0,round:!0,color:"#F5F7FB",onClick:this.onChange},{default:function(){return["PWD"===e.loginType?"验证码登录":"密码登录"]}})]),this.imgCodeStatus?f(b,{value:this.imgCodeStatus,"onUpdate:value":function(n){return e.imgCodeStatus=n},phone:this.username,onClose:function(){e.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();