1 |
- import{d as a,T as l,a as e,P as u,b as n,k as s,l as i,m,q as c,L as g}from"./vendor.0ee3b598.js";import"./validate.ae9d74d1.js";/* empty css *//* empty css */import{r as d}from"./vueFilter.991d8df4.js";const p="_imgCode_mywmt_1",h="_codeTitle_mywmt_4",r="_img_mywmt_1",C="_imgChange_mywmt_16",f="_field_mywmt_23",y="_imgCodePopup_mywmt_27";var t={imgCode:p,codeTitle:h,img:r,imgChange:C,field:f,imgCodePopup:y},S=a({name:"imgCode",props:{value:Boolean,phone:[String,Number],onClose:{type:Function,default:()=>{}},onSendCode:{type:Function,default:()=>{}}},data(){let o=window.location.origin;return{showStatus:!1,identifyingCode:o+"/api-student/code/getImageCode?phone="+this.phone,code:null}},mounted(){this.showStatus=this.value},watch:{value(o){this.showStatus=o},code(o){o.length>=4&&this.checkVerifyLoginImage()}},methods:{async updateIdentifyingCode(){let o=window.location.origin;this.identifyingCode=`${o}/api-student/code/getImageCode?phone=${this.phone}&token=${Math.random()}`},async checkVerifyLoginImage(){try{if(this.code.length<4)return;await d.post("/api-student/code/verifyLoginImage",{data:{phone:this.phone,code:this.code}}),await d.post("/api-student/code/sendSms",{data:{mobile:this.phone}}),l("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001"),this.onClose(),this.onSendCode()}catch{this.updateIdentifyingCode()}}},render(){return e(u,{show:this.showStatus,class:t.imgCodePopup,closeOnClickOverlay:!1,onClose:this.onClose,closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:t.imgCode},[e("p",{class:t.codeTitle},[n("\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801")]),e(s,null,{default:()=>[e(i,{span:"14"},{default:()=>[e(m,{placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",modelValue:this.code,"onUpdate:modelValue":o=>this.code=o,class:t.field},null)]}),e(i,{span:"10",class:t.img},{default:()=>[e(c,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(g,{type:"spinner",size:"20"},null)})]})]}),e(s,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(i,{span:"10"},{default:()=>[e("span",{class:t.imgChange,onClick:()=>this.updateIdentifyingCode()},[n("\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u6362")])]})]})])]})}});export{S as I};
|