1 |
- !function(){var e=["returnUrl","isRegister"];function t(e,t,n,o,r,a,i){try{var l=e[a](i),s=l.value}catch(u){return void n(u)}l.done?t(s):Promise.resolve(s).then(o,r)}function n(e){return function(){var n=this,o=arguments;return new Promise((function(r,a){var i=e.apply(n,o);function l(e){t(i,r,a,l,s,"next",e)}function s(e){t(i,r,a,l,s,"throw",e)}l(void 0)}))}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=document.createElement("style");l.innerHTML="._login_9la03_1{min-height:100vh;background:url(./assets/top_bg.a1440929.png) no-repeat top center,url(./assets/bottom_student_bg.47832732.png) no-repeat bottom center;background-color:#fff;background-size:100%}._login_9la03_1._TEACHER_9la03_7{background:url(./assets/top_bg.a1440929.png) no-repeat top center,url(./assets/bottom_teacher_bg.f552ebe4.png) no-repeat bottom center;background-color:#fff;background-size:100%}._login_9la03_1._SCHOOL_9la03_12{background:url(./assets/top_bg.a1440929.png) no-repeat top center,url(./assets/bottom_manage_bg.8d4dc7ca.png) no-repeat bottom center;background-color:#fff;background-size:100%}._login_9la03_1 ._loginTitle_9la03_17{padding-top:2.66667rem;font-size:.69333rem;padding-left:.93333rem;padding-bottom:1.86667rem;line-height:.98667rem;font-weight:500}._login_9la03_1 ._codeText_9la03_25{color:var(--van-primary-text)}._login_9la03_1 ._margin34_9la03_28{margin:0 .90667rem}._login_9la03_1 ._formTitle_9la03_31{font-size:.48rem;color:#000;font-weight:500}._login_9la03_1 .van-cell-group{margin-bottom:.93333rem}._login_9la03_1 .van-field{padding-left:0;padding-right:0}._login_9la03_1 .van-button+.van-button{margin-top:.53333rem;color:#000!important}\n",document.head.appendChild(l),System.register(["./index-legacy.90c82f08.js","./validate-legacy.6cdb2ccf.js","./index-legacy.55839436.js","./index-legacy.3c5580aa.js","./index-legacy.baa64f1d.js","./index-legacy.eb4bc59e.js","./index-legacy.f3e5e283.js"],(function(t){"use strict";var o,a,l,s,u,c,d,f,p,g,m,_,h,b,y,v,T;return{setters:[function(e){o=e.d,a=e.g,l=e.l,s=e.m,u=e.k,c=e.n,d=e.o,f=e.c,p=e.q,g=e.B},function(e){m=e.c,_=e.R,h=e.C,b=e.I},function(e){y=e.C},function(e){v=e.F},function(e){T=e.C},function(){},function(){}],execute:function(){var O={login:"_login_9la03_1",TEACHER:"_TEACHER_9la03_7",SCHOOL:"_SCHOOL_9la03_12",loginTitle:"_loginTitle_9la03_17",codeText:"_codeText_9la03_25",margin34:"_margin34_9la03_28",formTitle:"_formTitle_9la03_31"};t("default",o({name:"login",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,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},appName:function(){return{STUDENT:"学员端",TEACHER:"老师端",SCHOOL:"管理端"}[a.platformType]}},mounted:function(){l(),this.directNext()},methods:{directNext:function(){if("login"===a.user.status||"error"===a.user.status){var t=this.$route.query,n=t.returnUrl,o=(t.isRegister,i(t,e));this.$router.replace({path:n,query:r({},o)})}},onLogin:function(){var e=this;return n(regeneratorRuntime.mark((function t(){var n,o,i,l,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n={username:e.username,client_id:a.clientId[a.platformType],client_secret:a.clientId[a.platformType]},console.log("🚀 ~ state.clientId",a.clientId,a.platformType),"PWD"===e.loginType?(n.password=e.password,n.loginType="PASSWORD",n.grant_type="password"):(n.password=e.smsCode,n.loginType="SMS",n.grant_type="password"),t.next=6,s.post("/api-oauth/userlogin",{requestType:"form",data:r({},n)});case 6:return o=t.sent,i=o.data,u(i.token_type+" "+i.access_token),t.next=11,s.get(a.platformApi+"/user/getUserInfo",{initRequest:!0});case 11:l=t.sent,"SCHOOL"===a.platformType&&(d=l.data.schoolInfos?l.data.schoolInfos[0]:{},l.data.school=d),c(l.data),e.directNext(),t.next=19;break;case 17:t.prev=17,t.t0=t.catch(0);case 19:case"end":return t.stop()}}),t,null,[[0,17]])})))()},onSendCode:function(){var e=this;return n(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m(e.username)){t.next=2;break}return t.abrupt("return",d("请输入正确的手机号码"));case 2:e.imgCodeStatus=!0;case 3:case"end":return t.stop()}}),t)})))()},onCodeSend:function(){var e=this;this.countDownStatus=!1,this.$nextTick((function(){e.$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 e=this;return f("div",{class:[O.login,O[a.platformType]]},[f("div",{class:O.loginTitle},[p("您好,"),f("br",null,null),p(" 欢迎使用管乐团"),this.appName]),f(y,{class:O.margin34,border:!1},{default:function(){return[f(_,{style:{marginBottom:"16px"}},{default:function(){return[f(h,{span:24,class:O.formTitle},{default:function(){return[p("手机号")]}}),f(h,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(v,{modelValue:e.username,"onUpdate:modelValue":function(t){return e.username=t},name:"手机号",placeholder:"请输入您的手机号",type:"tel",maxlength:11},null)]}})]}}),"PWD"===e.loginType?f(_,null,{default:function(){return[f(h,{span:24,class:O.formTitle},{default:function(){return[p("密码")]}}),f(h,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(v,{modelValue:e.password,"onUpdate:modelValue":function(t){return e.password=t},type:"password",name:"密码",placeholder:"请输入密码"},null)]}})]}}):f(_,null,{default:function(){return[f(h,{span:24,class:O.formTitle},{default:function(){return[p("验证码")]}}),f(h,{span:24,class:"van-hairline--bottom"},{default:function(){return[f(v,{modelValue:e.smsCode,"onUpdate:modelValue":function(t){return e.smsCode=t},name:"验证码",placeholder:"请输入验证码",type:"tel",maxlength:6},{button:function(){return e.countDownStatus?f("span",{class:O.codeText,onClick:e.onSendCode},[p("获取验证码")]):f(T,{ref:"countDownRef","auto-start":!1,time:e.countDownTime,onFinish:e.onFinished,format:"ss秒"},null)}})]}})]}})]}}),f("div",{class:O.margin34},[f(g,{round:!0,block:!0,type:"primary",disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[p("提交")]}}),f(g,{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(t){return e.imgCodeStatus=t},phone:this.username,onClose:function(){e.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();
|