mirror of https://github.com/allinssl/allinssl
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{d as e,E as a,F as l,G as t,aG as r,e as s,s as n,f as o,r as u,aH as i,w as c,aI as d,o as p,$ as v,aJ as m,aK as w,c as g,af as h,B as _,H as f,aL as y,a as b,aM as x,p as C,t as k,L as z,aN as M,i as S}from"./main-DKqTMGci.js";import{u as L,I as D,m as j}from"./index-DoBLtCBk.js";import{l as I,a as H}from"./public-Dp0eFScr.js";import{u as O}from"./index-CpnxPwGt.js";import{L as A}from"./LockOutlined-Cnf7b3lD.js";import"./index-ClL52y7R.js";const B={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},E=e({name:"CodeOutlined",render:function(e,r){return l(),a("svg",B,r[0]||(r[0]=[t("path",{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 0 0 308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 0 0-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z",fill:"currentColor"},null,-1)]))}}),K={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},N=e({name:"UserOutlined",render:function(e,r){return l(),a("svg",K,r[0]||(r[0]=[t("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5a375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1c-.4.2-.8.3-1.2.5c-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8c2-77.2 33-149.5 87.8-204.3c56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z",fill:"currentColor"},null,-1)]))}}),U={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},V=e({name:"Language",render:function(e,r){return l(),a("svg",U,r[0]||(r[0]=[t("path",{d:"M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z",fill:"currentColor"},null,-1),t("path",{d:"M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z",fill:"currentColor"},null,-1)]))}}),G={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},P=e({name:"Moon",render:function(e,r){return l(),a("svg",G,r[0]||(r[0]=[t("path",{d:"M264 480A232 232 0 0 1 32 248c0-94 54-178.28 137.61-214.67a16 16 0 0 1 21.06 21.06C181.07 76.43 176 104.66 176 136c0 110.28 89.72 200 200 200c31.34 0 59.57-5.07 81.61-14.67a16 16 0 0 1 21.06 21.06C442.28 426 358 480 264 480z",fill:"currentColor"},null,-1)]))}}),T={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},F=e({name:"Sunny",render:function(e,t){return l(),a("svg",T,t[0]||(t[0]=[r('<path d="M256 118a22 22 0 0 1-22-22V48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22z" fill="currentColor"></path><path d="M256 486a22 22 0 0 1-22-22v-48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22z" fill="currentColor"></path><path d="M369.14 164.86a22 22 0 0 1-15.56-37.55l33.94-33.94a22 22 0 0 1 31.11 31.11l-33.94 33.94a21.93 21.93 0 0 1-15.55 6.44z" fill="currentColor"></path><path d="M108.92 425.08a22 22 0 0 1-15.55-37.56l33.94-33.94a22 22 0 1 1 31.11 31.11l-33.94 33.94a21.94 21.94 0 0 1-15.56 6.45z" fill="currentColor"></path><path d="M464 278h-48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44z" fill="currentColor"></path><path d="M96 278H48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44z" fill="currentColor"></path><path d="M403.08 425.08a21.94 21.94 0 0 1-15.56-6.45l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.55 37.56z" fill="currentColor"></path><path d="M142.86 164.86a21.89 21.89 0 0 1-15.55-6.44l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.56 37.55z" fill="currentColor"></path><path d="M256 358a102 102 0 1 1 102-102a102.12 102.12 0 0 1-102 102z" fill="currentColor"></path>',9)]))}}),{success:J}=o(),{handleError:R}=L(),$=s("login-store",(()=>{const e=u(null),a=u(""),l=O("login-token",""),t=u(!1),r=u({username:"",password:"",code:""}),s=O("remember-me",!1),n=u(null),{fetch:o,error:i,data:c,defaultData:d,message:p,loading:v}=I(),m=()=>{r.value.username="",r.value.password="",s.value=!1,i.value=null},w=async()=>{try{const{data:e}=await H();a.value=e.data}catch(e){R(e)}},g=()=>{const e=D("must_code",!1);t.value=1===Number(e),t.value&&w()};return{loading:v,codeImg:a,error:i,user:e,loginData:r,rememberMe:s,forgotPasswordRef:n,mustCode:t,handleLogin:async e=>{try{i.value=null,p.value=!0,await o(e);const{status:a}=c.value;if(!a)throw new Error(c.value.message);J("登录成功,正在跳转中..."),setTimeout((()=>location.href="/"),1e3),g()}catch(a){i.value=a.message,g()}},handleLogout:()=>{e.value=null,l.value=null,m(),location.href="/login"},handleGetCode:w,checkMustCode:g,resetForm:m,clearToken:()=>{l.value=null}}})),q=()=>{const e=localStorage.getItem("loginData");return e?JSON.parse(e):null},W=(e,a)=>{localStorage.setItem("loginData",JSON.stringify({username:e,password:a}))},Q=()=>{const e=(()=>{const e=$();return{...e,...n(e)}})(),{handleError:a}=L(),{error:l,loginData:t,handleLogin:r,resetForm:s,rememberMe:o,checkMustCode:u}=e,m=async e=>{var n;if(e.username.trim())if(e.password.trim())try{const a=(n=e.password,j(`${n}_bt_all_in_ssl`).toString());await r({...e,password:a}),o.value&&!l.value?W(e.username,e.password):l.value?t.value.password="":l.value||s()}catch(u){a(u)}else l.value=v("t_4_1744164840458");else l.value=v("t_3_1744164839524")},w=async e=>{e.preventDefault(),await m(t.value)},g=i();return g.run((()=>{c(l,(()=>{setTimeout((()=>{l.value=""}),5e3)})),d((()=>{g.stop()}))})),p((()=>{if(u(),o.value){const e=q();e&&(t.value=e)}})),{...e,handleSubmit:w,handleKeyup:e=>{"Enter"===e.key&&w(e)},handleLogin:m,getRememberData:q,setRememberData:W}},X="_container_13wi5_4",Y="_loginBox_13wi5_20",Z="_leftImageWrapper_13wi5_26",ee="_leftImage_13wi5_26",ae="_leftSection_13wi5_51",le="_leftTitle_13wi5_59",te="_logo_13wi5_63",re="_rightSection_13wi5_76",se="_title_13wi5_89",ne="_formContainer_13wi5_95",oe="_formWrapper_13wi5_101",ue="_formContent_13wi5_106",ie="_formInputs_13wi5_111",ce="_formActions_13wi5_130",de="_rememberSection_13wi5_135",pe="_error_13wi5_166",ve="_forgotPassword_13wi5_305",me="_icon_13wi5_310",we=e({props:{type:{type:String,default:"button"}},setup(e){const a=m("locales-active","zhCN"),l=w.map((e=>({label:e.name,key:e.type})));return()=>g(h,{options:l,onSelect:e=>a.value=e,value:a.value},{default:()=>[g("div",{style:{cursor:"pointer",display:"flex",alignItems:"center"}},["button"===e.type?g(_,{quaternary:!0,strong:!0,circle:!0,type:"primary"},{default:()=>[g(f,{size:20},{default:()=>[g(V,null,null)]})]}):g(f,{size:20},{default:()=>[g(V,null,null)]})])]})}}),ge=e({props:{type:{type:String,default:"button"}},setup(e){const{isDark:a,cutDarkMode:l,themeActive:t}=y(),r=[{label:"亮色模式",key:"defaultLight"},{label:"暗色模式",key:"defaultDark"}];return()=>g(h,{options:r,onSelect:()=>l(!0,this),value:t.value},{default:()=>[g("div",{style:{cursor:"pointer",display:"flex",alignItems:"center"}},["button"===e.type?g(_,{quaternary:!0,strong:!0,circle:!0,type:"primary"},{default:()=>[g(f,{size:20},{default:()=>[a.value?g(P,null,null):g(F,null,null)]})]}):g(f,{size:20},{default:()=>[a.value?g(P,null,null):g(F,null,null)]})])]})}});const he=e({setup(){const{loading:e,error:a,rememberMe:l,handleSubmit:t,handleKeyup:r,loginData:s,handleGetCode:n,codeImg:o,mustCode:u}=Q(),{isDark:i}=y(),c=b(["textColor2","actionColor","errorColor","primaryColor","primaryColorSuppl"]);return()=>{let d;return g("div",{style:c.value},[g("div",{class:X,style:`background-image:${i.value?"url(/static/images/login-bg-dark.svg)":"url(/static/images/login-bg.svg)"};`},[g("div",{class:"absolute z-[99] top-0 right-0 p-[2rem] flex w-[120px] justify-between"},[g(we,null,null),g(ge,null,null)]),g("div",{class:Y},[g("div",{class:ae},[g("h2",{class:le},[g("img",{src:"/static/images/logo.png",alt:"logo",class:te},null),g("span",null,[v("t_2_1747047214975")])]),g("div",{class:Z},[g("img",{src:"/static/images/login-display.svg",alt:v("t_1_1744164835667"),class:ee},null)])]),g("div",{class:re},[g("div",{class:ne},[g("h1",{class:se},[v("t_2_1744164839713")]),g(x,{onSubmit:t,class:oe},{default:()=>{return[g("div",{class:ue},[g("div",{class:ie},[g(C,{"show-label":!1},{default:()=>[g(k,{value:s.value.username,"onUpdate:value":e=>s.value.username=e,onKeyup:r,disabled:e.value,placeholder:v("t_3_1744164839524"),clearable:!0,size:"large"},{prefix:()=>g(f,{component:N,class:me},null)})]}),g(C,{"show-label":!1},{default:()=>[g(k,{onKeyup:r,disabled:e.value,value:s.value.password,"onUpdate:value":e=>s.value.password=e,type:"password",placeholder:v("t_4_1744164840458"),clearable:!0,size:"large",showPasswordOn:"click"},{prefix:()=>g(f,{component:A,class:me},null)})]}),u.value?g(C,{"show-label":!1},{default:()=>[g(k,{onKeyup:r,disabled:e.value,value:s.value.code,"onUpdate:value":e=>s.value.code=e,type:"text",placeholder:v("t_25_1745289355721"),clearable:!0,size:"large",showPasswordOn:"click"},{prefix:()=>g(f,{component:E,class:me},null),suffix:()=>g("span",{onClick:n,title:v("t_0_1745936396853"),class:"w-[10rem] h-[4rem] mr-[-1.5rem] relative z-[999] cursor-pointer bg-slate-400 rounded-r-[6px]"},[g(z,{src:o.value,"preview-disabled":!0},null)])})]}):null]),g("div",{class:ce},[g("div",{class:de},[g(M,{checked:l.value,onUpdateChecked:e=>l.value=e},(i=d=v("t_5_1744164840468"),"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!S(i)?d:{default:()=>[d]})),g("a",{class:ve,href:"https://www.bt.cn/bbs/thread-144776-1-1.html",target:"_blank"},[v("t_6_1744164838900")])]),a.value&&g("div",{class:pe},[a.value]),g(_,{type:"primary",size:"large",block:!0,loading:e.value,onClick:t},{default:()=>[e.value?v("t_7_1744164838625"):v("t_8_1744164839833")]})])])];var i}})])])])])])}}});export{he as default};
|