login-ed15e275.js 8.2 KB

1
  1. import{C as c,I as d}from"./index-a934fb09.js";import{d as h,r as m,s as l,a as i,b as r,c as p,e as g,f as k,g as t,h as u,B as f}from"./index-1d4a9afa.js";import{C as R}from"./index-b8090118.js";import{F as a}from"./index-dbc03ded.js";import"./index-fd6c1051.js";import"./index-c272bcfa.js";import"./index-a27d7671.js";const y="_login_pvck2_1",E="_codeText_pvck2_6",S="_logo_pvck2_9",Y="_container_pvck2_21",s={login:y,codeText:E,logo:S,container:Y,"input-group":"_input-group_pvck2_24","code-text":"_code-text_pvck2_45","login-change":"_login-change_pvck2_62"},A="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+gy5OVZGkxaGFhfS7yBLoqDZDX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Kv7BEtkRyEPViwImxBXU4BiLmJPp69owgxAEIto0MOP+kD0tmtktI+k/4+LlazdGkcxyACgLOIVmtuDvvOUUj2YV6ktGF0gKqIpYlltqghJx31gRup1e22JOjs5rVdtgQkxogoRTQkHeUo/YR+YO+uOnbERN6qiutk+QcWF5XGXfQSi6xTY1oVpX4LPtD0ozzqFMm6gMSwV/i/icd1fzqY1Xa5ggt6gtF3+4JpeMm/BdL5Peb4E4sa31NDYK+0MlAfrRtUYOfUiPci3fkLEWN1EUvEBJ9SznJQ8KIUwzVPCvDp6VkrHueoGQM+mdT44vmyxieZATVmTkRi+HmWCJDZpwISg4sU2CEiRMM8UopoquykEodHLzPuKb/XlKhAmatGmXPcrNdq9SZsuVQalstc4TjRNR0YRSghtttXopzcCys7WpDC3gMboiSCowuusZQ25vjSvOCa41umMZhhM0SMKC/Nwqy6qFVc2dGl//o3+g5v+pZK/+F4+J9vmfIGG8oTUTZlDzD25KepVdwiRSi7d1jhXddWEUq/i45BiZhSUGKrDLFAOrARKERVGd21MLXCslesVfRuKqoLVTc9aq8cKlkthalFUiE/MeeA0lwoSGzj3zsofUqJOtwRLswr9a6ancoff53mr55kvTAvJrrqtsSqwDz+LDNP/hUe/7Y7k05H3rw0JeK3WiL65GF9MikRPSlWrsekbP5jYfIAh8mjRB4Nk4faTB6v9FiYPOhr8si5R8Tk4Ydj8BtP5UjXgZbThAAAAABJRU5ErkJggg==",V=h({name:"layout-login",data(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:1e3*120,imgCodeStatus:!1}},computed:{codeDisable(){let e=!0;return this.loginType==="PWD"?this.username&&this.password&&(e=!1):this.username&&this.smsCode&&(e=!1),e}},mounted(){m(),this.directNext()},methods:{directNext(){if(l.user.status==="login"||l.user.status==="error"){const{returnUrl:e,isRegister:n,...o}=this.$route.query;this.$router.replace({path:e,query:{...o}})}},async onLogin(){try{const e={phone:this.username,clientId:"EDUCATION",clientSecret:"EDUCATION"};if(this.loginType==="PWD"){e.password=this.password,e.grant_type="password";const{data:o}=await i.post("/api-auth/usernameLogin",{requestType:"form",data:{...e}});r(o.authentication.token_type+" "+o.authentication.access_token)}else{e.smsCode=this.smsCode;const{data:o}=await i.post("/api-auth/smsLogin",{requestType:"form",data:{...e}});r(o.authentication.token_type+" "+o.authentication.access_token)}const n=await i.get("/api-web/schoolStaff/queryUserInfo",{initRequest:!0});p(n.data),this.directNext()}catch(e){}},async onSendCode(){if(!g(this.username))return k("请输入正确的手机号码");this.imgCodeStatus=!0},onCodeSend(){this.countDownStatus=!1,this.$nextTick(()=>{this.$refs.countDownRef.start()})},onFinished(){this.countDownStatus=!0,this.$refs.countDownRef.reset()},onChange(){this.loginType==="PWD"?this.loginType="SMS":this.loginType==="SMS"&&(this.loginType="PWD")}},render(){return t("div",{class:[s.login]},[t("div",{class:s.logo},[t("img",{src:A},null)]),t(R,{class:s.container,border:!1},{default:()=>[t(a,{modelValue:this.username,"onUpdate:modelValue":e=>this.username=e,name:"手机号",placeholder:"请输入您的手机号",type:"tel",class:s["input-group"],maxlength:11},null),this.loginType==="PWD"?t(a,{modelValue:this.password,"onUpdate:modelValue":e=>this.password=e,type:"password",name:"密码",class:s["input-group"],placeholder:"请输入密码"},null):t(a,{modelValue:this.smsCode,"onUpdate:modelValue":e=>this.smsCode=e,name:"验证码",placeholder:"请输入验证码",type:"tel",class:s["input-group"],maxlength:6},{button:()=>this.countDownStatus?t("span",{class:s.codeText,onClick:this.onSendCode},[u("获取验证码")]):t(c,{ref:"countDownRef","auto-start":!1,time:this.countDownTime,onFinish:this.onFinished,format:"ss秒"},null)})]}),t("div",{class:s.margin34},[t(f,{round:!0,block:!0,disabled:this.codeDisable,onClick:this.onLogin},{default:()=>[u("提交")]}),t("span",{class:s["login-change"],onClick:this.onChange},[this.loginType==="PWD"?"验证码登录":"密码登录"])]),this.imgCodeStatus?t(d,{value:this.imgCodeStatus,"onUpdate:value":e=>this.imgCodeStatus=e,phone:this.username,onClose:()=>{this.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}});export{V as default};