import{t as e,N as t,v as s,x as o,d as i,y as a,c as n,a as l,w as c,G as r,C as d,ba as u,bb as p,S as m,ag as h,s as g,e as f,_ as y,P as S,m as k,au as R,bc as w,aH as E,bd as v,be as C,bf as Y,B as A}from"./index-232a7449.js";import{F as U}from"./index-a3e2983b.js";import{I as x}from"./index-4d5d4bfb.js";import{C as I}from"./index-b026a759.js";import"./index-b3c0f2c5.js";const[T,L]=e("row"),M=Symbol(T);var V=i({name:T,props:{tag:t("div"),wrap:s,align:String,gutter:o(0),justify:String},setup(e,{slots:t}){const{children:s,linkChildren:o}=a(M),i=n((()=>{const e=[[]];let t=0;return s.forEach(((s,o)=>{t+=Number(s.span),t>24?(e.push([o]),t-=24):e[e.length-1].push(o)})),e}));return o({spaces:n((()=>{const t=Number(e.gutter),s=[];return t?(i.value.forEach((e=>{const o=t*(e.length-1)/e.length;e.forEach(((e,i)=>{if(0===i)s.push({right:o});else{const i=t-s[e-1].right,a=o-i;s.push({left:i,right:a})}}))})),s):s}))}),()=>{const{tag:s,wrap:o,align:i,justify:a}=e;return l(s,{"class":L({["align-".concat(i)]:i,["justify-".concat(a)]:a,nowrap:!o})},{"default":()=>{var e;return[null==(e=t["default"])?void 0:e.call(t)]}})}}});const[D,H]=e("col"),j=d(i({name:D,props:{tag:t("div"),span:o(0),offset:c},setup(e,{slots:t}){const{parent:s,index:o}=r(M),i=n((()=>{if(!s)return;const{spaces:e}=s;if(e&&e.value&&e.value[o.value]){const{left:t,right:s}=e.value[o.value];return{paddingLeft:t?"".concat(t,"px"):null,paddingRight:s?"".concat(s,"px"):null}}}));return()=>{const{tag:s,span:o,offset:a}=e;return l(s,{style:i.value,"class":H({[o]:o,["offset-".concat(a)]:a})},{"default":()=>{var e;return[null==(e=t["default"])?void 0:e.call(t)]}})}}})),[N,P]=e("count-down"),b=d(i({name:N,props:{time:o(0),format:t("HH:mm:ss"),autoStart:s,millisecond:Boolean},emits:["change","finish"],setup(e,{emit:t,slots:s}){const{start:o,pause:i,reset:a,current:c}=p({time:+e.time,millisecond:e.millisecond,onChange:e=>t("change",e),onFinish:()=>t("finish")}),r=n((()=>function(e,t){const{days:s}=t;let{hours:o,minutes:i,seconds:a,milliseconds:n}=t;if(e.includes("DD")?e=e.replace("DD",u(s)):o+=24*s,e.includes("HH")?e=e.replace("HH",u(o)):i+=60*o,e.includes("mm")?e=e.replace("mm",u(i)):a+=60*i,e.includes("ss")?e=e.replace("ss",u(a)):n+=1e3*a,e.includes("S")){const t=u(n,3);e=e.includes("SSS")?e.replace("SSS",t):e.includes("SS")?e.replace("SS",t.slice(0,2)):e.replace("S",t.charAt(0))}return e}(e.format,c.value))),d=()=>{a(+e.time),e.autoStart&&o()};return m((()=>e.time),d,{immediate:!0}),h({start:o,pause:i,reset:d}),()=>l("div",{role:"timer","class":P()},[s["default"]?s["default"](c.value):r.value])}})),G=d(V),F=i({name:"imgCode",props:{value:Boolean,phone:[String,Number],onClose:{type:Function,"default":()=>({})},onSendCode:{type:Function,"default":()=>({})}},data(){return{showStatus:!1,identifyingCode:window.location.origin+g.platformApi+"/code/getLoginImage?phone="+this.phone,code:null}},mounted(){this.showStatus=this.value},watch:{value(e){this.showStatus=e},code(e){e.length>=4&&this.checkVerifyLoginImage()}},methods:{async updateIdentifyingCode(){const e=window.location.origin;this.identifyingCode="".concat(e).concat(g.platformApi,"/code/getLoginImage?phone=").concat(this.phone,"&token=").concat(Math.random())},async checkVerifyLoginImage(){try{if(this.code.length<4)return;await f.post("".concat(g.platformApi,"/code/sendSmsCode"),{requestType:"form",data:{mobile:this.phone,type:"LOGIN",code:this.code}}),y("验证码已发送"),this.onClose(),this.onSendCode()}catch(e){this.updateIdentifyingCode()}}},render(){return l(S,{show:this.showStatus,"class":"_imgCodePopup_mywmt_27",closeOnClickOverlay:!1,onClose:()=>{this.onClose()},closeable:!0,closeIcon:"close"},{"default":()=>[l("div",{"class":"_imgCode_mywmt_1"},[l("p",{"class":"_codeTitle_mywmt_4"},[k("输入图形验证码")]),l(G,null,{"default":()=>[l(j,{span:"14"},{"default":()=>[l(U,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":e=>this.code=e,"class":"_field_mywmt_23",maxlength:4},null)]}),l(j,{span:"10","class":"_img_mywmt_1"},{"default":()=>[R(l(x,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},null),[[w("slot"),{loading:()=>l(E,{type:"spinner",size:"20"},null)}]])]})]}),l(G,{style:{display:"flex",justifyContent:"end"}},{"default":()=>[l(j,{span:"10"},{"default":()=>[l("span",{"class":"_imgChange_mywmt_16",onClick:()=>this.updateIdentifyingCode()},[k("看不清?换一换")])]})]})])]})}}),O={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"},W=i({name:"layout-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}},mounted(){v(),this.directNext()},methods:{directNext(){if("login"===g.user.status||"error"===g.user.status){const{returnUrl:e,isRegister:t,...s}=this.$route.query;this.$router.replace({path:e,query:{...s}})}},async onLogin(){try{let e;e="PWD"===this.loginType?await f.post("/api-auth/usernameLogin",{requestType:"form",data:{username:this.username,password:this.password,clientId:g.platformType,clientSecret:g.platformType}}):await f.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:g.platformType,clientSecret:g.platformType,phone:this.username,smsCode:this.smsCode}});const{authentication:t}=e.data;C(t.token_type+" "+t.access_token);const s=await f.get("STUDENT"===g.platformType?g.platformApi+"/student/queryUserInfo":g.platformApi+"/teacher/queryUserInfo",{initRequest:!0});Y(s.data),this.directNext()}catch(e){}},async onSendCode(){if(e=this.username,!/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/.test(e))return y("请输入正确的手机号码");var e;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 l("div",{"class":[O.login]},[l("div",{"class":O.logo},[l("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAABaCAMAAAD3n9+rAAABNVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8BwbUUxrsNxbn4/v0eyb7v/Ptz3ddb2NCi6eRp29RB0snX9vQ4z8YlysC07uqX5uG/8O2r6+ff+PbN8/Hn+vnG8u/S9fKP5N+H4t1L1Mxg2dFW1s5R1c1H08oyzsR+4NopzMJi2dIuzGsgAAAARHRSTlMA5i4ftQTXEmFTg9odCBSWeDQOXKROt3X9RgyB7Uzx0wL79UI847oG+OrMKsWwrW/5yZMZJF5piIxkn1nA39yZp3x+gHwyDdUAAAy8SURBVHja7NppVxJRHMfxP8hqDSli4oTsMMgmW5KaWfbDrbJFS8v2zPf/EmKYueLAHWa4w7HOoc9DfTJ89c69/3ugAXKwUannUhhLKlevNIIy/dclbXgKEFbwbEg07ZKBHBzKBZI01TIJTEAiQ1NsLoqJiM7RtJIimJjIlL4ZpTImqDydFSOYqAhNoTlM2BS+FzNRTFh06vboZAJ2HH3b3/v19fNH2JFIkoUZTZPMyDMamSZHcmezWT+Jac6HyVQAthx3NK/PYUOARvKWoVsjvmwcmniTJiRTTaErPU8iGlGk18mElIMthx3m5REs5SQa5QF0hRJxSU+gy5OVZGkxaGFhfS7yBLoqDZDX2qoNL1n8q6XcxLcBe/Y6136fwdIGjTCfgm6XSAn1yaRrQJduEflDfcmh3A/SYA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xyACgLOIVmtuDvvOUUj2YV6ktGF0gKqIpYlltqghJx31gRup1e22JOjs5rVdtgQkxogoRTQkHeUo/YR+YO+uOnbERN6qiutk+QcWF5XGXfQSi6xTY1oVpX4LPtD0ozzqFMm6gMSwV/i/icd1fzqY1Xa5ggt6gtF3+4JpeMm/BdL5Peb4E4sa31NDYK+0MlAfrRtUYOfUiPci3fkLEWN1EUvEBJ9SznJQ8KIUwzVPCvDp6VkrHueoGQM+mdT44vmyxieZATVmTkRi+HmWCJDZpwISg4sU2CEiRMM8UopoquykEodHLzPuKb/XlKhAmatGmXPcrNdq9SZsuVQalstc4TjRNR0YRSghtttXopzcCys7WpDC3gMboiSCowuusZQ25vjSvOCa41umMZhhM0SMKC/Nwqy6qFVc2dGl//o3+g5v+pZK/+F4+J9vmfIGG8oTUTZlDzD25KepVdwiRSi7d1jhXddWEUq/i45BiZhSUGKrDLFAOrARKERVGd21MLXCslesVfRuKqoLVTc9aq8cKlkthalFUiE/MeeA0lwoSGzj3zsofUqJOtwRLswr9a6ancoff53mr55kvTAvJrrqtsSqwDz+LDNP/hUe/7Y7k05H3rw0JeK3WiL65GF9MikRPSlWrsekbP5jYfIAh8mjRB4Nk4faTB6v9FiYPOhr8si5R8Tk4Ydj8BtP5UjXgZbThAAAAABJRU5ErkJggg=="},null)]),l(I,{"class":O.container,border:!1},{"default":()=>[l(U,{modelValue:this.username,"onUpdate:modelValue":e=>this.username=e,name:"手机号",placeholder:"请输入您的手机号",type:"tel",autocomplete:"off","class":O["input-group"],maxlength:11},null),"PWD"===this.loginType?l(U,{modelValue:this.password,"onUpdate:modelValue":e=>this.password=e,type:"password",name:"密码",autocomplete:"off","class":O["input-group"],placeholder:"请输入密码"},null):l(U,{modelValue:this.smsCode,"onUpdate:modelValue":e=>this.smsCode=e,name:"验证码",placeholder:"请输入验证码",type:"tel","class":O["input-group"],autocomplete:"off",maxlength:6},{button:()=>this.countDownStatus?l("span",{"class":O.codeText,onClick:this.onSendCode},[k("获取验证码")]):l(b,{ref:"countDownRef","auto-start":!1,time:this.countDownTime,onFinish:this.onFinished,format:"ss秒"},null)})]}),l("div",{"class":O.margin34},[l(A,{round:!0,block:!0,disabled:this.codeDisable,onClick:this.onLogin},{"default":()=>[k("提交")]}),l("span",{"class":O["login-change"],onClick:this.onChange},["PWD"===this.loginType?"验证码登录":"密码登录"])]),this.imgCodeStatus?l(F,{value:this.imgCodeStatus,"onUpdate:value":e=>this.imgCodeStatus=e,phone:this.username,onClose:()=>{this.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}});export{W as default};