You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.1 KiB
JavaScript

import{_ as H,dH as M,bn as z,dI as J,dJ as O,dK as P,f as c,br as Q,e as W,bs as S,o as u,c as X,h as n,j as o,cG as R,a as t,w as _,i as g,k as T,dL as B,dM as Y,dN as Z,b as p,dO as ee,dP as N,dc as U,d as K,dQ as oe,$ as ne,dR as se,s as te,dS as ae,y as le,v as _e,bE as ce,bF as ue}from"./index.ba6d2826.js";import{a as re}from"./headers.44e59c79.js";import{_ as de}from"./Input.a5e3f92d.js";import{_ as ie}from"./Checkbox.4929fce7.js";import"./Suffix.236be5c8.js";const pe=r=>(ce("data-v-93454da0"),r=r(),ue(),r),fe={class:"login_logo_wrapper"},ve=["src"],me={class:"login_space_image_wrapper"},ge=["src"],ke={class:"login_space_form_wrapper"},ye={"mt-5":""},we={"mt-5":""},$e={"mt-5":""},he={"mt-10":""},be={"mt-5":""},xe=pe(()=>n("div",{class:"login_space_form_divider_wrapper"},null,-1)),L={__name:"login",setup(r){const A=M(),k=z(),y=J(),w=O(),$=P(),d=c(""),l=c(""),f=c(!1),E=s=>{f.value=s},h={f:"/"},b=c(h);Q(s=>{x(s.query)});const x=s=>{b.value={f:s.f||h.f}};W(()=>{x(S.currentRoute.value.query)});const v=async()=>{const s=d.value.replace(/^\s+|\s+$/g,"");if(s==="")return window.$message().error("\u8BF7\u8F93\u5165\u8D26\u53F7");if(l.value==="")return window.$message().error("\u8BF7\u8F93\u5165\u5BC6\u7801");const e=await oe({account:s,password:l.value});ne(e,()=>{f.value?(y.value="local",w.value="",$.value=e.data.token):(y.value="session",w.value=e.data.token,$.value=""),se(),S.push(decodeURIComponent(b.value.f))})},F=()=>{l.value===""?C.value.focus():v()},C=c(null),V=s=>{C.value=s};return(s,e)=>{const j=re,I=de,m=te,q=ie,D=ae,i=le,G=_e;return u(),X("div",{class:"login_page_wrapper",style:U({background:o(A).app_theme+"20"})},[n("div",fe,[n("img",{src:o(R)(o(k).config.Logo),alt:""},null,8,ve)]),n("div",{class:"login_space_wrapper shadow-lg",style:U({background:o(N)?"#333333":"#ffffff"})},[n("div",me,[n("img",{src:o(R)(o(k).config.Login\u6B22\u8FCE\u56FE\u7247),alt:""},null,8,ge)]),n("div",ke,[n("div",ye,[t(j,null,{default:_(()=>[g("\u767B\u5F55")]),_:1})]),n("div",we,[t(I,{value:o(d),"onUpdate:value":e[0]||(e[0]=a=>T(d)?d.value=a:null),onKeydown:e[1]||(e[1]=B(a=>F(),["enter"])),placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7"},null,8,["value"])]),n("div",$e,[t(I,{ref:V,type:"password",onKeydown:e[2]||(e[2]=B(a=>v(),["enter"])),value:o(l),"onUpdate:value":e[3]||(e[3]=a=>T(l)?l.value=a:null),placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801"},null,8,["value"])]),n("div",he,[t(m,{onClick:e[4]||(e[4]=a=>v()),type:"primary","w-full":""},{default:_(()=>[g("\u767B\u5F55")]),_:1})]),n("div",be,[t(q,{"onUpdate:checked":E,"default-checked":o(f)},{default:_(()=>[g("\u81EA\u52A8\u767B\u5F55")]),_:1},8,["default-checked"])]),xe,t(D,{dashed:""}),t(G,{justify:"center"},{default:_(()=>[t(m,{text:"",onClick:e[5]||(e[5]=a=>o(Y)()),"mr-5":""},{default:_(()=>[o(Z)?(u(),p(i,{key:0,type:"off-screen"})):(u(),p(i,{key:1,type:"full-screen"}))]),_:1}),t(m,{text:"",onClick:e[6]||(e[6]=a=>o(ee)()),"mr-5":""},{default:_(()=>[o(N)?(u(),p(i,{key:0,type:"sun-one"})):(u(),p(i,{key:1,type:"moon"}))]),_:1})]),_:1})])],4)],4)}}};typeof K=="function"&&K(L);var Be=H(L,[["__scopeId","data-v-93454da0"]]);export{Be as default};