!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=["returnUrl","isRegister"];function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return e};var e={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new L(r||[]);return i(a,"_invoke",{value:k(t,n,c)}),a}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(C){return{type:"throw",arg:C}}}e.wrap=f;var h={};function d(){}function g(){}function v(){}var m={};s(m,c,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(P([])));_&&_!==r&&o.call(_,c)&&(m=_);var b=v.prototype=d.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(e,n){function r(i,a,c,u){var l=p(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):n.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,o){r(t,e,n,o)}))}return a=a?a.then(o,o):o()}})}function k(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=p(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(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 j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function r(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(l){return void n(l)}c.done?e(u):Promise.resolve(u).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(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 a(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}System.register(["./index-legacy-2b919b1e.js","./index-legacy-27256ebb.js","./index-legacy-758b88ca.js","./index-legacy-308727fb.js","./index-legacy-ab18b6ff.js","./index-legacy-92a4c7a7.js","./index-legacy-11a37866.js"],(function(t,r){"use strict";var i,c,l,s,f,p,h,d,g,v,m,y,_,b,w;return{setters:[function(t){i=t.d,c=t.s,l=t.A,s=t.a,f=t.r,p=t.b,h=t.c,d=t.e,g=t.f,v=t.g,m=t.B},function(t){y=t.C,_=t.I},function(t){b=t.C},function(t){w=t.F},null,null,null],execute:function(){var r=document.createElement("style");r.textContent="._login_pvck2_1{min-height:100vh;padding:0 1.28rem;background:linear-gradient(to bottom,#01c1b5,#1bcbbf)}._login_pvck2_1 ._codeText_pvck2_6{color:#fff}._login_pvck2_1 ._logo_pvck2_9{display:table;padding-top:2.66667rem;padding-bottom:2.4rem;width:4.26667rem;height:1.2rem;margin:0 auto}._login_pvck2_1 ._logo_pvck2_9 img{width:inherit;height:inherit}._login_pvck2_1 ._container_pvck2_21{background-color:transparent}._login_pvck2_1 ._input-group_pvck2_24{position:relative;border-radius:1.33333rem;border:.05333rem solid #fff;margin-bottom:.53333rem;padding-left:.8rem;padding-right:.8rem;display:flex;align-items:center;background:transparent}._login_pvck2_1 ._input-group_pvck2_24 input{flex:1;font-size:.37333rem;color:#fff;background:transparent;border:none}._login_pvck2_1 ._input-group_pvck2_24 input::-moz-placeholder{color:#fff}._login_pvck2_1 ._input-group_pvck2_24 input::placeholder{color:#fff}._login_pvck2_1 ._input-group_pvck2_24 ._code-text_pvck2_45{position:absolute;right:0;flex:1;display:block;width:2.50667rem;text-align:center;font-size:.37333rem;color:#fff;line-height:.8rem;height:.8rem}._login_pvck2_1 ._input-group_pvck2_24 .van-field__button{border-left:.05333rem solid #fff;margin-left:.32rem;margin-right:-.48rem}._login_pvck2_1 ._login-change_pvck2_62{padding-top:.21333rem;font-size:.37333rem;color:#fff;float:right;cursor:pointer}._login_pvck2_1 .van-button--disabled{opacity:1;color:rgba(0,0,0,.25)}\n",document.head.appendChild(r);var x={login:"_login_pvck2_1",codeText:"_codeText_pvck2_6",logo:"_logo_pvck2_9",container:"_container_pvck2_21","input-group":"_input-group_pvck2_24","code-text":"_code-text_pvck2_45","login-change":"_login-change_pvck2_62"};t("default",i({name:"layout-login",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,imgCodeStatus:!1}},computed:{codeDisable:function(){var t=!0;return"PWD"===this.loginType?this.username&&this.password&&(t=!1):this.username&&this.smsCode&&(t=!1),t}},mounted:function(){c.remove(l),this.directNext()},methods:{directNext:function(){if("login"===s.user.status||"error"===s.user.status){var t=this.$route.query,n=t.returnUrl,r=(t.isRegister,u(t,e));this.$router.replace({path:n,query:a({},r)})}},onLogin:function(){var t=this;return o(n().mark((function e(){var r,o,i,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r={username:t.username,client_id:"cooleshow-student",client_secret:"cooleshow-student",password:"PWD"===t.loginType?t.password:t.smsCode,grant_type:"password",loginType:"PWD"===t.loginType?"PASSWORD":"SMS"},e.next=4,f.post("/edu-oauth/userlogin",{requestType:"form",data:a({},r)});case 4:return o=e.sent,i=o.data,c.set(l,i.token_type+" "+i.access_token),e.next=9,f.get("/edu-app/user/getUserInfo",{initRequest:!0});case 9:u=e.sent,p(u.data),t.directNext(),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.log(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})))()},onSendCode:function(){var t=this;return o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h(t.username)){e.next=2;break}return e.abrupt("return",d("请输入正确的手机号码"));case 2:t.imgCodeStatus=!0;case 3:case"end":return e.stop()}}),e)})))()},onCodeSend:function(){var t=this;this.countDownStatus=!1,this.$nextTick((function(){t.$refs.countDownRef.start()}))},onFinished:function(){this.countDownStatus=!0,this.$refs.countDownRef.reset()},onChange:function(){"PWD"===this.loginType?this.loginType="SMS":"SMS"===this.loginType&&(this.loginType="PWD")}},render:function(){var t=this;return g("div",{class:[x.login]},[g("div",{class:x.logo},null),g(b,{class:x.container,border:!1},{default:function(){return[g(w,{modelValue:t.username,"onUpdate:modelValue":function(e){return t.username=e},name:"手机号",placeholder:"请输入您的手机号",type:"tel",class:x["input-group"],maxlength:11,autocomplete:"off"},null),"PWD"===t.loginType?g(w,{modelValue:t.password,"onUpdate:modelValue":function(e){return t.password=e},type:"password",name:"密码",class:x["input-group"],placeholder:"请输入密码",autocomplete:"off"},null):g(w,{modelValue:t.smsCode,"onUpdate:modelValue":function(e){return t.smsCode=e},name:"验证码",placeholder:"请输入验证码",type:"tel",class:x["input-group"],maxlength:6,autocomplete:"off"},{button:function(){return t.countDownStatus?g("span",{class:x.codeText,onClick:t.onSendCode},[v("获取验证码")]):g(y,{ref:"countDownRef","auto-start":!1,time:t.countDownTime,onFinish:t.onFinished,format:"ss秒"},null)}})]}}),g("div",{class:x.margin34},[g(m,{round:!0,block:!0,disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[v("提交")]}}),g("span",{class:x["login-change"],onClick:this.onChange},["PWD"===this.loginType?"验证码登录":"密码登录"])]),this.imgCodeStatus?g(_,{value:this.imgCodeStatus,"onUpdate:value":function(e){return t.imgCodeStatus=e},phone:this.username,onClose:function(){t.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();