mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-17 04:42:49 +00:00
2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
import{d as U,r as i,j as K,s as M,k as s,l as F,m as E,w as c,n as W,q as $,v as D,x as A,y as G,h as a,c as u,e as n,a as l,u as p,z as H,t as d,A as R,i as J,B as _,F as O,f as Q,C as X,D as Y,G as Z,E as ee,H as te,I as oe}from"./index-a59af0dd.js";import se from"./Verify-bb1ff41e.js";/* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{g as ae,a as ne}from"./sys-d9b3645a.js";import"./VerifySlide-afca6b9a.js";import"./index-5fe18556.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VerifyPoints-45bf8753.js";const le=""+new URL("niushop_login_index_left-6f34059f.jpg",import.meta.url).href,re={class:"flex rounded-2xl shadow overflow-hidden"},ie={class:"login-main-left w-[450px] flex flex-wrap justify-center"},ce={key:1,src:le,alt:""},ue={class:"login flex flex-col w-[400px] h-[400px] p-[40px]"},pe={class:"text-center text-lg font-bold mb-[10px]"},de={class:"text-center text-2xl font-bold mb-[26px]"},me={key:0,class:"flex items-center justify-center mt-[20px] pb-[20px] text-sm text-[#999]"},_e=["href"],fe={key:0,class:"mr-3"},ge={key:1,class:"mr-3"},he={key:0,href:"https://beian.miit.gov.cn/",target:"_blank"},ve={class:"mr-3"},xe=["href"],ye={class:"mr-3"},Ne=U({__name:"index",setup(we){$("setLayout")("decorate");const f=i(!1),k=i(!1),j=K(),v=D(),B=Q(),o=i(null),C=i([]);ae().then(({data:e})=>{o.value=e}),ne().then(({data:e})=>{C.value=e}),v.redirectedFrom&&(v.query.redirect=v.redirectedFrom.path),M(s("adminLogin"));const V=i(null),S=e=>{L({captcha_code:e.captchaVerification})},r=F({username:"",password:""}),x=i({});(async()=>{k.value=!0;const e=await(await A()).data;x.value=e,k.value=!1})();const y=i(),q=F({username:[{required:!0,message:s("userPlaceholder"),trigger:"blur"}],password:[{required:!0,message:s("passwordPlaceholder"),trigger:"blur"}]}),b=async e=>{f.value||!e||await e.validate((t,g)=>{t&&(parseInt(x.value.is_captcha)?V.value.show():L())})},L=(e={})=>{f.value=!0,j.login({username:r.username,password:r.password,...e}).then(t=>{const{query:{redirect:g}}=v,w=typeof g=="string"?g:"/",h=B.resolve(w);location.href=h.href}).catch(()=>{f.value=!1})};return(e,t)=>{const g=X,w=Y,h=Z,z=ee,I=te,P=oe,N=se,T=G;return a(),E(T,{class:W(["w-full h-screen bg-page flex flex-col","login-wrap"])},{default:c(()=>[k.value?_("",!0):(a(),u(O,{key:0},[n(P,{class:"login-main items-center justify-center flex-1 h-0"},{default:c(()=>[l("div",re,[l("div",ie,[x.value.bg?(a(),E(g,{key:0,class:"w-[450px] h-[400px]",src:p(H)(x.value.bg),fit:"cover"},null,8,["src"])):(a(),u("img",ce))]),l("div",ue,[l("h3",pe,d(C.value.site_name||p(s)("siteTitle")),1),l("h3",de,d(p(s)("platform")),1),n(I,{model:r,ref_key:"formRef",ref:y,rules:q,class:"mt-[30px]"},{default:c(()=>[n(h,{prop:"username"},{default:c(()=>[n(w,{modelValue:r.username,"onUpdate:modelValue":t[0]||(t[0]=m=>r.username=m),modelModifiers:{trim:!0},placeholder:p(s)("userPlaceholder"),autocomplete:"off",onKeyup:t[1]||(t[1]=R(m=>b(y.value),["enter"])),class:"h-[40px]"},null,8,["modelValue","placeholder"])]),_:1}),n(h,{prop:"password"},{default:c(()=>[n(w,{modelValue:r.password,"onUpdate:modelValue":t[2]||(t[2]=m=>r.password=m),modelModifiers:{trim:!0},placeholder:p(s)("passwordPlaceholder"),type:"password",autocomplete:"new-password",onKeyup:t[3]||(t[3]=R(m=>b(y.value),["enter"])),"show-password":!0,class:"h-[40px]"},null,8,["modelValue","placeholder"])]),_:1}),n(h,null,{default:c(()=>[n(z,{type:"primary",class:"mt-[30px] !h-[40px] w-full",onClick:t[4]||(t[4]=m=>b(y.value)),loading:f.value},{default:c(()=>[J(d(f.value?p(s)("logging"):p(s)("login")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["model","rules"])])])]),_:1}),o.value?(a(),u("div",me,[l("a",{href:o.value.copyright_link,target:"_blank"},[o.value.copyright_desc?(a(),u("span",fe,d(o.value.copyright_desc),1)):_("",!0),o.value.company_name?(a(),u("span",ge,d(o.value.company_name),1)):_("",!0)],8,_e),o.value.icp?(a(),u("a",he,[l("span",ve,d(o.value.icp),1)])):_("",!0),o.value.gov_record?(a(),u("a",{key:1,href:o.value.gov_url,target:"_blank"},[l("span",ye,d(o.value.gov_record),1)],8,xe)):_("",!0)])):_("",!0)],64)),n(N,{onSuccess:S,mode:e.pop,captchaType:"blockPuzzle",imgSize:{width:"330px",height:"155px"},ref_key:"verifyRef",ref:V},null,8,["mode"])]),_:1})}}});export{Ne as default};
|