login-legacy.0a35eb8d.js 7.7 KB

1
  1. !function(){var e=["returnUrl","isRegister"],t=["returnUrl","isRegister"];function n(e,t,n,r,o,i,u){try{var a=e[i](u),s=a.value}catch(c){return void n(c)}a.done?t(s):Promise.resolve(s).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var u=e.apply(t,r);function a(e){n(u,o,i,a,s,"next",e)}function s(e){n(u,o,i,a,s,"throw",e)}a(void 0)}))}}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(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){u(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 u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=document.createElement("style");s.innerHTML="._login_18sy9_1{min-height:100vh;background:url(./assets/top_bg.8024f4e9.png) no-repeat top center,url(./assets/bottom_bg.74772616.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(["./ResizeObserver.es-legacy.26eb1cf8.js","./index-legacy.60487b6d.js","./index-legacy.aa58f7fa.js","./index-legacy.df4f1e2f.js","./index-legacy.51934712.js","./index-legacy.e636fde8.js","./index-legacy.066a0018.js","./validate-legacy.c1df5f0e.js","./use-id-legacy.8c265e97.js","./index-legacy.5c4870ce.js"],(function(n){"use strict";var o,u,s,c,l,d,f,p,g,m,y,h,b,_,v,w,x,O;return{setters:[function(e){o=e.d,u=e.h,s=e.g,c=e.y,l=e.u,d=e.T,f=e.i,p=e.X,g=e.j,m=e.A,y=e.B},function(e){h=e.C},function(){},function(e){b=e.F},function(e){_=e.C},function(e){v=e.R,w=e.C},function(e){x=e.I},function(e){O=e.c},function(){},function(){}],execute:function(){var S="_login_18sy9_1",j="_loginTitle_18sy9_7",T="_codeText_18sy9_15",C="_margin34_18sy9_18",D="_formTitle_18sy9_21";n("default",o({name:"login",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,countDownRef:null,imgCodeStatus:!1,isTrainGroup:!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(){"/train-tool"===this.$route.query.returnUrl&&this.$route.query.taId&&(this.isTrainGroup=!0),u(),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,a(t,e));this.$router.replace({path:n,query:i({},r)})}},onLogin:function(){var e=this;return r(regeneratorRuntime.mark((function n(){var r,o,u,s,p,g,m,y;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,c.post("/api-auth/usernameLogin",{requestType:"form",data:{username:e.username,password:e.password,clientId:"student",clientSecret:"student"}});case 4:r=n.sent,n.next=10;break;case 7:return n.next=9,c.post("/api-auth/smsLogin",{requestType:"form",hideErrorMessage:e.isTrainGroup,data:{clientId:"student",clientSecret:"student",phone:e.username,smsCode:e.smsCode}});case 9:r=n.sent;case 10:return o=r.data.authentication,l(o.token_type+" "+o.access_token),n.next=14,c.get("/api-student/student/queryUserInfo",{initRequest:!0});case 14:if(u=n.sent,!e.isTrainGroup){n.next=20;break}if(s=e.$route.query,p=s.tenantGroupId,g=s.tenantId,p==u.data.tenantGroupId&&g==u.data.tenantId){n.next=20;break}return setTimeout((function(){d("您的所在小组不可购买该教程")}),100),n.abrupt("return");case 20:f(u.data),e.directNext(),n.next=30;break;case 24:if(n.prev=24,n.t0=n.catch(0),!(n.t0.message.indexOf("验证码校验失败")>-1)){n.next=29;break}return d("验证码校验失败"),n.abrupt("return");case 29:n.t0.message.indexOf("409")>-1&&e.isTrainGroup&&"PWD"!==e.loginType&&(m=e.$route.query,m.returnUrl,m.isRegister,y=a(m,t),e.$router.replace({path:"/tenantStudentRejest",query:i({},y)}));case 30:case"end":return n.stop()}}),n,null,[[0,24]])})))()},onSendCode:function(){var e=this;return r(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(O(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,p((function(){e.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 g("div",{class:S},[g("div",{class:j},[m("您好,"),g("br",null,null),m(" 欢迎使用酷乐秀")]),g(h,{class:C,border:!1},{default:function(){return[g(v,{style:{marginBottom:"16px"}},{default:function(){return[g(w,{span:24,class:D},{default:function(){return[m("手机号")]}}),g(w,{span:24,class:"van-hairline--bottom"},{default:function(){return[g(b,{modelValue:e.username,"onUpdate:modelValue":function(t){return e.username=t},name:"手机号",placeholder:"请输入您的手机号",type:"tel",maxlength:11},null)]}})]}}),"PWD"===e.loginType?g(v,null,{default:function(){return[g(w,{span:24,class:D},{default:function(){return[m("密码")]}}),g(w,{span:24,class:"van-hairline--bottom"},{default:function(){return[g(b,{modelValue:e.password,"onUpdate:modelValue":function(t){return e.password=t},type:"password",name:"密码",placeholder:"请输入密码"},null)]}})]}}):g(v,null,{default:function(){return[g(w,{span:24,class:D},{default:function(){return[m("验证码")]}}),g(w,{span:24,class:"van-hairline--bottom"},{default:function(){return[g(b,{modelValue:e.smsCode,"onUpdate:modelValue":function(t){return e.smsCode=t},name:"验证码",placeholder:"请输入验证码",type:"tel",maxlength:6},{button:function(){return e.countDownStatus?g("span",{class:T,onClick:e.onSendCode},[m("获取验证码")]):g(_,{ref:function(t){return e.countDownRef=t},"auto-start":!1,time:e.countDownTime,onFinish:e.onFinished,format:"ss秒"},null)}})]}})]}})]}}),g("div",{class:C},[g(y,{round:!0,block:!0,type:"primary",disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[m("提交")]}}),g(y,{block:!0,round:!0,color:"#F5F7FB",onClick:this.onChange},{default:function(){return["PWD"===e.loginType?"验证码登录":"密码登录"]}})]),this.imgCodeStatus?g(x,{value:this.imgCodeStatus,"onUpdate:value":function(t){return e.imgCodeStatus=t},phone:this.username,onClose:function(){e.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();