niucloud-admin/niucloud/public/web/_nuxt/register.4e456d5b.js
全栈小学生 0e47055ccb v1.0.0-beta.1
2023-04-15 17:12:49 +08:00

2 lines
6.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{u as z,t as N,E as D,_ as T}from"./test.5fa42c56.js";import{E as j}from"./el-input.695ad1b0.js";import{E as G,a as $}from"./el-overlay.d34bed94.js";import{E as H}from"./el-button.41e73ba9.js";import{_ as J}from"./nuxt-link.c2db7583.js";import{a as M,b as O,s as Q,r as b,e as P,f as Y,o as w,i as y,j as d,l as s,u as e,J as K,F as W,x as X,w as n,y as V,z as k,k as a,m as x,t as h,K as Z,L as ee,D as oe,E as le,G as se}from"./entry.08c6ab45.js";import{u as ae}from"./useLogin.f8a66f0c.js";import{_ as re}from"./_plugin-vue_export-helper.c27b6911.js";import"./throttle.d003d777.js";import"./debounce.3db11f73.js";import"./system.6cdccf49.js";import"./use-form-item.7dcbf65b.js";import"./index.34f12059.js";import"./vnode.7865e18e.js";const C=f=>(le("data-v-aea9e448"),f=f(),se(),f),te={class:"w-full h-full bg-page flex items-center justify-center"},ie={class:"flex bg-white"},ne={class:"flex flex-col items-center w-[330px] py-[100px] border-r"},de=C(()=>d("div",{class:"title font-bold text-xl"},"打开手机微信",-1)),me=C(()=>d("div",{class:"tips text-sm mt-[5px]"},"点击右上角打开扫一扫",-1)),ue={class:"qrcode mt-[30px] border leading-none"},pe={class:"bg-white w-[380px] p-[30px]"},ce={class:"flex items-end my-[30px]"},ge=["onClick"],fe={class:"py-0 leading-none"},_e={class:"flex justify-end leading-none"},be=M({__name:"register",setup(f){const E=O(),p=Q();p.getLoginConfig();const i=b(""),R=P(()=>{const o=[];return p.login.is_username&&o.push({type:"username",title:a("usernameRegister")}),p.login.is_mobile&&!p.login.is_bind_mobile&&o.push({type:"mobile",title:a("mobileRegister")}),i.value=o[0]?o[0].type:"",o}),g=b(!1),r=Y({username:"",password:"",confirm_password:"",mobile:"",mobile_code:"",mobile_key:"",captcha_key:"",captcha_code:""}),q=P(()=>({username:{type:"string",required:i.value=="username",message:a("usernamePlaceholder"),trigger:["blur","change"]},password:{type:"string",required:i.value=="username",message:a("passwordPlaceholder"),trigger:["blur","change"]},confirm_password:[{type:"string",required:i.value=="username",message:a("confirmPasswordPlaceholder"),trigger:["blur","change"]},{validator(o,l,c){return l==r.password},message:a("confirmPasswordError"),trigger:["change","blur"]}],mobile:[{type:"string",required:i.value=="mobile"||p.login.is_bind_mobile,message:a("mobilePlaceholder"),trigger:["blur","change"]},{validator(o,l,c){return i.value!="mobile"&&!p.login.is_bind_mobile?!0:N.mobile(l)},message:a("mobileError"),trigger:["change","blur"]}],mobile_code:{type:"string",required:i.value=="mobile"||p.login.is_bind_mobile,message:a("codePlaceholder"),trigger:["blur","change"]},captcha_code:{type:"string",required:i.value=="username",message:a("captchaPlaceholder"),trigger:["blur","change"]}})),v=b(),L=async()=>{var o;await((o=v.value)==null?void 0:o.validate(async(l,c)=>{if(l){if(g.value)return;g.value=!0,(i.value=="username"?Z:ee)(r).then(u=>{E.setToken(u.data.token),ae().handleLoginBack()}).catch(()=>{g.value=!1,_.refresh()})}}))},_=z(r);_.refresh();const A=b(null),U=async()=>{var o;await((o=v.value)==null?void 0:o.validateField("mobile",async(l,c)=>{var m;l&&((m=A.value)==null||m.send())}))};return(o,l)=>{const c=D,m=j,u=G,I=T,S=H,B=J,F=$;return w(),y("div",te,[d("div",ie,[d("div",ne,[de,me,d("div",ue,[s(c,{src:("img"in o?o.img:e(K))("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHU7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAySlJSbU1Sb0hiMlQxOEcwSGhBY1AAAgTSfStkAwRYAgAA"),class:"w-[120px]"},null,8,["src"])])]),d("div",pe,[d("div",ce,[(w(!0),y(W,null,X(e(R),t=>(w(),y("div",{class:oe(["mr-[20px] text-base cursor-pointer leading-none",{"font-bold":e(i)==t.type}]),onClick:he=>i.value=t.type},h(t.title),11,ge))),256))]),s(F,{model:e(r),ref_key:"formRef",ref:v,rules:e(q),"validate-on-rule-change":!1},{default:n(()=>[V(d("div",null,[s(u,{prop:"username"},{default:n(()=>[s(m,{modelValue:e(r).username,"onUpdate:modelValue":l[0]||(l[0]=t=>e(r).username=t),placeholder:("t"in o?o.t:e(a))("usernamePlaceholder"),clearable:"","inline-message":!0},null,8,["modelValue","placeholder"])]),_:1}),s(u,{prop:"password"},{default:n(()=>[s(m,{modelValue:e(r).password,"onUpdate:modelValue":l[1]||(l[1]=t=>e(r).password=t),placeholder:("t"in o?o.t:e(a))("passwordPlaceholder"),type:"password",clearable:"","show-password":!0},null,8,["modelValue","placeholder"])]),_:1}),s(u,{prop:"confirm_password"},{default:n(()=>[s(m,{modelValue:e(r).confirm_password,"onUpdate:modelValue":l[2]||(l[2]=t=>e(r).confirm_password=t),placeholder:("t"in o?o.t:e(a))("confirmPasswordPlaceholder"),type:"password",clearable:"","show-password":!0},null,8,["modelValue","placeholder"])]),_:1})],512),[[k,e(i)=="username"]]),V(d("div",null,[s(u,{prop:"mobile"},{default:n(()=>[s(m,{modelValue:e(r).mobile,"onUpdate:modelValue":l[3]||(l[3]=t=>e(r).mobile=t),placeholder:("t"in o?o.t:e(a))("mobilePlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),_:1}),s(u,{prop:"mobile_code"},{default:n(()=>[s(m,{modelValue:e(r).mobile_code,"onUpdate:modelValue":l[5]||(l[5]=t=>e(r).mobile_code=t),placeholder:("t"in o?o.t:e(a))("codePlaceholder")},{suffix:n(()=>[s(I,{mobile:e(r).mobile,type:"login",modelValue:e(r).mobile_key,"onUpdate:modelValue":l[4]||(l[4]=t=>e(r).mobile_key=t),onClick:U,ref_key:"smsCodeRef",ref:A},null,8,["mobile","modelValue"])]),_:1},8,["modelValue","placeholder"])]),_:1})],512),[[k,e(i)=="mobile"||e(p).login.is_bind_mobile]]),V(d("div",null,[s(u,{prop:"captcha_code"},{default:n(()=>[s(m,{modelValue:e(r).captcha_code,"onUpdate:modelValue":l[7]||(l[7]=t=>e(r).captcha_code=t),placeholder:("t"in o?o.t:e(a))("captchaPlaceholder")},{suffix:n(()=>[d("div",fe,[s(c,{src:e(_).image.value,class:"h-[30px] cursor-pointer",onClick:l[6]||(l[6]=t=>e(_).refresh())},null,8,["src"])])]),_:1},8,["modelValue","placeholder"])]),_:1})],512),[[k,e(i)=="username"]]),d("div",_e,[s(B,{to:"/auth/login"},{default:n(()=>[s(S,{type:"primary",link:""},{default:n(()=>[x(h(("t"in o?o.t:e(a))("haveAccount"))+""+h(("t"in o?o.t:e(a))("toLogin")),1)]),_:1})]),_:1})]),s(u,null,{default:n(()=>[s(S,{type:"primary",class:"mt-[20px] w-full",size:"large",onClick:L,loading:e(g)},{default:n(()=>[x(h(e(g)?("t"in o?o.t:e(a))("registering"):("t"in o?o.t:e(a))("register")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["model","rules"])])])])}}});const Ue=re(be,[["__scopeId","data-v-aea9e448"]]);export{Ue as default};