login-legacy.5b280e62.js 5.4 KB

1
  1. !function(){var e=document.createElement("style");e.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(e),System.register(["./validate-legacy.fbaff68b.js","./index-legacy.1971670f.js","./index-legacy.ceff034b.js","./index-legacy.69d96dc4.js","./index-legacy.97a16eb5.js","./index-legacy.214c148b.js","./index-legacy.ae3ee09f.js"],(function(e){"use strict";var t,o,n,a,s,l,i,r,d,c,u,g,p,m,_,h,f;return{setters:[function(e){t=e.c,o=e.R,n=e.C,a=e.I},function(e){s=e.d,l=e.g,i=e.l,r=e.m,d=e.k,c=e.n,u=e.o,g=e.c,p=e.q,m=e.B},function(e){_=e.C},function(e){h=e.F},function(e){f=e.C},function(){},function(){}],execute:function(){var b={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"};e("default",s({name:"login",data:()=>({loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,imgCodeStatus:!1}),computed:{codeDisable(){let e=!0;return"PWD"===this.loginType?this.username&&this.password&&(e=!1):this.username&&this.smsCode&&(e=!1),e},appName:()=>({STUDENT:"学员端",TEACHER:"老师端",SCHOOL:"管理端"}[l.platformType])},mounted(){i(),this.directNext()},methods:{directNext(){if("login"===l.user.status||"error"===l.user.status){const{returnUrl:e,isRegister:t,...o}=this.$route.query;this.$router.replace({path:e,query:{...o}})}},async onLogin(){try{const e={username:this.username,client_id:l.clientId[l.platformType],client_secret:l.clientId[l.platformType]};console.log("🚀 ~ state.clientId",l.clientId,l.platformType),"PWD"===this.loginType?(e.password=this.password,e.loginType="PASSWORD",e.grant_type="password"):(e.password=this.smsCode,e.loginType="SMS",e.grant_type="password");const{data:t}=await r.post("/api-oauth/userlogin",{requestType:"form",data:{...e}});d(t.token_type+" "+t.access_token);const o=await r.get(l.platformApi+"/user/getUserInfo",{initRequest:!0});if("SCHOOL"===l.platformType){const e=o.data.schoolInfos?o.data.schoolInfos[0]:{};o.data.school=e}c(o.data),this.directNext()}catch{}},async onSendCode(){if(!t(this.username))return u("请输入正确的手机号码");this.imgCodeStatus=!0},onCodeSend(){this.countDownStatus=!1,this.$nextTick((()=>{this.$refs.countDownRef.start()}))},onFinished(){this.countDownStatus=!0,this.$refs.countDownRef.reset()},onChange(){"PWD"===this.loginType?this.loginType="SMS":"SMS"===this.loginType&&(this.loginType="PWD")}},render(){return g("div",{class:[b.login,b[l.platformType]]},[g("div",{class:b.loginTitle},[p("您好,"),g("br",null,null),p(" 欢迎使用管乐团"),this.appName]),g(_,{class:b.margin34,border:!1},{default:()=>[g(o,{style:{marginBottom:"16px"}},{default:()=>[g(n,{span:24,class:b.formTitle},{default:()=>[p("手机号")]}),g(n,{span:24,class:"van-hairline--bottom"},{default:()=>[g(h,{modelValue:this.username,"onUpdate:modelValue":e=>this.username=e,name:"手机号",placeholder:"请输入您的手机号",type:"tel",maxlength:11},null)]})]}),"PWD"===this.loginType?g(o,null,{default:()=>[g(n,{span:24,class:b.formTitle},{default:()=>[p("密码")]}),g(n,{span:24,class:"van-hairline--bottom"},{default:()=>[g(h,{modelValue:this.password,"onUpdate:modelValue":e=>this.password=e,type:"password",name:"密码",placeholder:"请输入密码"},null)]})]}):g(o,null,{default:()=>[g(n,{span:24,class:b.formTitle},{default:()=>[p("验证码")]}),g(n,{span:24,class:"van-hairline--bottom"},{default:()=>[g(h,{modelValue:this.smsCode,"onUpdate:modelValue":e=>this.smsCode=e,name:"验证码",placeholder:"请输入验证码",type:"tel",maxlength:6},{button:()=>this.countDownStatus?g("span",{class:b.codeText,onClick:this.onSendCode},[p("获取验证码")]):g(f,{ref:"countDownRef","auto-start":!1,time:this.countDownTime,onFinish:this.onFinished,format:"ss秒"},null)})]})]})]}),g("div",{class:b.margin34},[g(m,{round:!0,block:!0,type:"primary",disabled:this.codeDisable,onClick:this.onLogin},{default:()=>[p("提交")]}),g(m,{block:!0,round:!0,color:"#F5F7FB",onClick:this.onChange},{default:()=>["PWD"===this.loginType?"验证码登录":"密码登录"]})]),this.imgCodeStatus?g(a,{value:this.imgCodeStatus,"onUpdate:value":e=>this.imgCodeStatus=e,phone:this.username,onClose:()=>{this.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();