mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-11 17:42:47 +00:00
2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
import{u as X,E as ee,_ as ae,t as le,__tla as re}from"./test.006ed1dd.js";import{E as te,__tla as se}from"./el-input.83f676ee.js";import{E as oe,a as ie,__tla as ne}from"./el-overlay.bb0ec5f3.js";import{E as ce,__tla as de}from"./el-button.583c8b81.js";import{_ as me,__tla as ue}from"./nuxt-link.f42f3b30.js";import{f as pe,h as _e,a5 as ge,x as b,i as U,a1 as he,o as y,k as v,l as c,m as t,u as a,Z as fe,$ as be,w as i,S as A,W as V,p as w,t as u,y as ye,ab as ve,ac as we,ad as xe,C as ke,q as r,s as Ae,v as Ve,__tla as Pe}from"./entry.b7343dfb.js";import{u as qe,__tla as Se}from"./useLogin.85c6b305.js";import{_ as Ue}from"./_plugin-vue_export-helper.c27b6911.js";import{__tla as Ce}from"./throttle.5ca6dfae.js";import{__tla as Ee}from"./debounce.34bb4a32.js";import{__tla as Le}from"./use-form-item.0e2797b4.js";import{__tla as Re}from"./index.27f7c24a.js";import{__tla as je}from"./index.053969da.js";import{__tla as ze}from"./vnode.82bc5779.js";let C,Fe=Promise.all([(()=>{try{return re}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return ze}catch{}})()]).then(async()=>{const P=h=>(Ae("data-v-f81f6c25"),h=h(),Ve(),h),E={class:"w-full h-full bg-page flex items-center justify-center"},L={class:"flex bg-white"},R={class:"flex flex-col items-center w-[330px] py-[100px] border-r"},j=P(()=>c("div",{class:"title font-bold text-xl"},"\u6253\u5F00\u624B\u673A\u5FAE\u4FE1",-1)),z=P(()=>c("div",{class:"tips text-sm mt-[5px]"},"\u70B9\u51FB\u53F3\u4E0A\u89D2\u6253\u5F00\u626B\u4E00\u626B",-1)),F={class:"qrcode mt-[30px] border leading-none"},T={class:"bg-white w-[380px] p-[30px]"},B={class:"flex items-end my-[30px]"},G=["onClick"],H={class:"py-0 leading-none"},O={class:"flex justify-end leading-none"},Q={key:0,class:"text-xs py-[50rpx] flex justify-center w-full"},Y={class:"text-primary"},I={class:"text-primary"},J=pe({__name:"register",setup(h){const M=_e(),m=ge();m.getLoginConfig();const n=b(""),N=U(()=>{const e=[];return m.login.is_username&&e.push({type:"username",title:r("usernameRegister")}),m.login.is_mobile&&!m.login.is_bind_mobile&&e.push({type:"mobile",title:r("mobileRegister")}),n.value=e[0]?e[0].type:"",e}),g=b(!1),s=he({username:"",password:"",confirm_password:"",mobile:"",mobile_code:"",mobile_key:"",captcha_key:"",captcha_code:""}),W=U(()=>({username:{type:"string",required:n.value=="username",message:r("usernamePlaceholder"),trigger:["blur","change"]},password:{type:"string",required:n.value=="username",message:r("passwordPlaceholder"),trigger:["blur","change"]},confirm_password:[{type:"string",required:n.value=="username",message:r("confirmPasswordPlaceholder"),trigger:["blur","change"]},{validator(e,l,_){return l==s.password},message:r("confirmPasswordError"),trigger:["change","blur"]}],mobile:[{type:"string",required:n.value=="mobile"||m.login.is_bind_mobile,message:r("mobilePlaceholder"),trigger:["blur","change"]},{validator(e,l,_){return n.value!="mobile"&&!m.login.is_bind_mobile?!0:le.mobile(l)},message:r("mobileError"),trigger:["change","blur"]}],mobile_code:{type:"string",required:n.value=="mobile"||m.login.is_bind_mobile,message:r("codePlaceholder"),trigger:["blur","change"]},captcha_code:{type:"string",required:n.value=="username",message:r("captchaPlaceholder"),trigger:["blur","change"]}})),x=b(),Z=async()=>{var e;await((e=x.value)==null?void 0:e.validate(async(l,_)=>{if(l){if(g.value)return;g.value=!0,(n.value=="username"?ve:we)(s).then(d=>{M.setToken(d.data.token),qe().handleLoginBack()}).catch(()=>{g.value=!1,f.refresh()})}}))},f=X(s);f.refresh();const q=b(null),$=async()=>{var e;await((e=x.value)==null?void 0:e.validateField("mobile",async(l,_)=>{var d;l&&((d=q.value)==null||d.send())}))};return(e,l)=>{const _=ee,d=te,p=oe,D=ae,S=ce,k=me,K=ie;return y(),v("div",E,[c("div",L,[c("div",R,[j,z,c("div",F,[t(_,{src:("img"in e?e.img:a(xe))("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHU7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAySlJSbU1Sb0hiMlQxOEcwSGhBY1AAAgTSfStkAwRYAgAA"),class:"w-[120px]"},null,8,["src"])])]),c("div",T,[c("div",B,[(y(!0),v(fe,null,be(a(N),o=>(y(),v("div",{class:ke(["mr-[20px] text-base cursor-pointer leading-none",{"font-bold":a(n)==o.type}]),onClick:Te=>n.value=o.type},u(o.title),11,G))),256))]),t(K,{model:a(s),ref_key:"formRef",ref:x,rules:a(W),"validate-on-rule-change":!1},{default:i(()=>[A(c("div",null,[t(p,{prop:"username"},{default:i(()=>[t(d,{modelValue:a(s).username,"onUpdate:modelValue":l[0]||(l[0]=o=>a(s).username=o),placeholder:("t"in e?e.t:a(r))("usernamePlaceholder"),clearable:"","inline-message":!0},null,8,["modelValue","placeholder"])]),_:1}),t(p,{prop:"password"},{default:i(()=>[t(d,{modelValue:a(s).password,"onUpdate:modelValue":l[1]||(l[1]=o=>a(s).password=o),placeholder:("t"in e?e.t:a(r))("passwordPlaceholder"),type:"password",clearable:"","show-password":!0},null,8,["modelValue","placeholder"])]),_:1}),t(p,{prop:"confirm_password"},{default:i(()=>[t(d,{modelValue:a(s).confirm_password,"onUpdate:modelValue":l[2]||(l[2]=o=>a(s).confirm_password=o),placeholder:("t"in e?e.t:a(r))("confirmPasswordPlaceholder"),type:"password",clearable:"","show-password":!0},null,8,["modelValue","placeholder"])]),_:1})],512),[[V,a(n)=="username"]]),A(c("div",null,[t(p,{prop:"mobile"},{default:i(()=>[t(d,{modelValue:a(s).mobile,"onUpdate:modelValue":l[3]||(l[3]=o=>a(s).mobile=o),placeholder:("t"in e?e.t:a(r))("mobilePlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),_:1}),t(p,{prop:"mobile_code"},{default:i(()=>[t(d,{modelValue:a(s).mobile_code,"onUpdate:modelValue":l[5]||(l[5]=o=>a(s).mobile_code=o),placeholder:("t"in e?e.t:a(r))("codePlaceholder")},{suffix:i(()=>[t(D,{mobile:a(s).mobile,type:"login",modelValue:a(s).mobile_key,"onUpdate:modelValue":l[4]||(l[4]=o=>a(s).mobile_key=o),onClick:$,ref_key:"smsCodeRef",ref:q},null,8,["mobile","modelValue"])]),_:1},8,["modelValue","placeholder"])]),_:1})],512),[[V,a(n)=="mobile"||a(m).login.is_bind_mobile]]),A(c("div",null,[t(p,{prop:"captcha_code"},{default:i(()=>[t(d,{modelValue:a(s).captcha_code,"onUpdate:modelValue":l[7]||(l[7]=o=>a(s).captcha_code=o),placeholder:("t"in e?e.t:a(r))("captchaPlaceholder")},{suffix:i(()=>[c("div",H,[t(_,{src:a(f).image.value,class:"h-[30px] cursor-pointer",onClick:l[6]||(l[6]=o=>a(f).refresh())},null,8,["src"])])]),_:1},8,["modelValue","placeholder"])]),_:1})],512),[[V,a(n)=="username"]]),c("div",O,[t(k,{to:"/auth/login"},{default:i(()=>[t(S,{type:"primary",link:""},{default:i(()=>[w(u(("t"in e?e.t:a(r))("haveAccount"))+"\uFF0C"+u(("t"in e?e.t:a(r))("toLogin")),1)]),_:1})]),_:1})]),t(p,null,{default:i(()=>[t(S,{type:"primary",class:"mt-[20px] w-full",size:"large",onClick:Z,loading:a(g)},{default:i(()=>[w(u(a(g)?("t"in e?e.t:a(r))("registering"):("t"in e?e.t:a(r))("register")),1)]),_:1},8,["loading"])]),_:1}),a(m).login.agreement_show?(y(),v("div",Q,[w(u(("t"in e?e.t:a(r))("registerAgreeTips"))+" ",1),t(k,{to:"/auth/agreement?key=service"},{default:i(()=>[c("span",Y,u(("t"in e?e.t:a(r))("userAgreement")),1)]),_:1}),w(" "+u(("t"in e?e.t:a(r))("and"))+" ",1),t(k,{to:"/auth/agreement?key=privacy"},{default:i(()=>[c("span",I,u(("t"in e?e.t:a(r))("privacyAgreement")),1)]),_:1})])):ye("",!0)]),_:1},8,["model","rules"])])])])}}});C=Ue(J,[["__scopeId","data-v-f81f6c25"]])});export{Fe as __tla,C as default};
|