1 |
- import{a8 as B,ca as v,R as w,cb as C,m as n,bV as g}from"./index.56449854.js";const E=/^\d{6}$/,f=/^[0-9A-Za-z]{6,18}$/;B({username:[{validator(r,e,u){e?v(e)?u():u(new Error("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")):u(new Error("\u8BF7\u8F93\u5165\u624B\u673A\u53F7"))},trigger:"blur"}],password:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u5BC6\u7801")):f.test(e)?u():u(new Error("\u5BC6\u7801\u683C\u5F0F\u5E94\u4E3A6-18\u4F4D\u6570\u5B57\u3001\u5B57\u6BCD\u7684\u7EC4\u5408"))},trigger:"blur"}],verifyCode:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):w().verifyCode!==e?u(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801")):u()},trigger:"blur"}]});const D=B({phone:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801")):C(e)?u():u(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801\u683C\u5F0F"))},trigger:"blur"}],verifyCode:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):E.test(e)?u():u(new Error("\u8BF7\u8F93\u51656\u4F4D\u6570\u5B57\u9A8C\u8BC1\u7801"))},trigger:"blur"}]}),p=B({phone:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801")):C(e)?u():u(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801\u683C\u5F0F"))},trigger:"blur"}],verifyCode:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):E.test(e)?u():u(new Error("\u8BF7\u8F93\u51656\u4F4D\u6570\u5B57\u9A8C\u8BC1\u7801"))},trigger:"blur"}],password:[{validator:(r,e,u)=>{e===""?u(new Error("\u8BF7\u8F93\u5165\u5BC6\u7801")):f.test(e)?u():u(new Error("\u5BC6\u7801\u683C\u5F0F\u5E94\u4E3A8-18\u4F4D\u6570\u5B57\u3001\u5B57\u6BCD\u3001\u7B26\u53F7\u7684\u4EFB\u610F\u4E24\u79CD\u7EC4\u5408"))},trigger:"blur"}]}),o=n(!1),i="\u83B7\u53D6\u9A8C\u8BC1\u7801",t=n(null),F=n(i),y=()=>({isDisabled:o,timer:t,text:F,start:async(u,l,s=60)=>{if(!u)return;const a=g(s);await u.validateField(l,d=>{d&&(clearInterval(t.value),t.value=setInterval(()=>{s>0?(F.value=`${s}\u79D2\u540E\u91CD\u65B0\u83B7\u53D6`,o.value=!0,s-=1):(F.value=i,o.value=!1,clearInterval(t.value),s=a)},1e3))})},end:()=>{F.value=i,o.value=!1,clearInterval(t.value)}});export{p as a,D as p,y as u};
|