Files
CloudFlare-ImgBed/js/548.872506ac.js
T
Se@n 276efb8a1c Update: Frontend asset build refresh
- Rebuild hashed CSS/JS bundles for production
- Update index.html with new asset references
- Remove old compiled assets
- Refresh frontend build files
2025-10-11 13:40:40 +08:00

2 lines
4.1 KiB
JavaScript

"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[548],{4452:function(e,t,s){s.d(t,{A:function(){return v}});var n=s(6975),a=s(47),i=(s(5331),s(9648),s(9623)),l=(s(9092),s(4632)),o=s(3525),r=s(6768),d=s(4232),u=s(5130);const c={class:"login"},h={class:"login-container"},p={class:"login-title",tabindex:"0"},m={class:"input-wrapper"};function f(e,t,s,f,b,g){const y=o.A,k=l.A,w=i.WK,v=a.S2,L=n.A;return(0,r.uX)(),(0,r.CE)("div",c,[(0,r.bF)(y,{class:"toggle-dark"}),(0,r.bF)(k),(0,r.Lk)("div",h,[(0,r.Lk)("h1",p,(0,d.v_)(s.title),1),((0,r.uX)(!0),(0,r.CE)(r.FK,null,(0,r.pI)(s.fields,(e,s)=>((0,r.uX)(),(0,r.CE)("div",{key:e.key,class:"input-container"},[(0,r.Lk)("label",{class:"input-name",ref_for:!0,ref:`inputLabel${s}`,style:(0,d.Tr)({"--underline-width":b.labelUnderlineWidths[s]+"px"})},(0,d.v_)(e.label),5),(0,r.Lk)("div",m,[(0,r.bF)(w,{modelValue:b.formData[e.key],"onUpdate:modelValue":t=>b.formData[e.key]=t,placeholder:e.placeholder,type:e.type||"text","show-password":e.showPassword,class:"password-input",onKeyup:(0,u.jR)(g.handleSubmit,["enter","native"]),onFocus:g.handleInputFocus,onBlur:g.handleInputBlur},null,8,["modelValue","onUpdate:modelValue","placeholder","type","show-password","onKeyup","onFocus","onBlur"]),t[0]||(t[0]=(0,r.Lk)("div",{class:"input-underline"},null,-1))])]))),128)),(0,r.bF)(v,{class:"submit",type:"primary",onClick:g.handleSubmit},{default:(0,r.k6)(()=>[(0,r.eW)((0,d.v_)(s.submitText),1)]),_:1},8,["onClick"])]),(0,r.bF)(L,{class:"footer"})])}s(8111),s(7588);var b=s(782),g=s(8903),y={name:"BaseLogin",mixins:[g.A],props:{title:{type:String,required:!0},fields:{type:Array,required:!0},submitText:{type:String,default:"登录"},backgroundKey:{type:String,required:!0},isAdmin:{type:Boolean,default:!1}},data(){return{formData:{},labelUnderlineWidths:[]}},computed:{...(0,b.L8)(["userConfig"])},watch:{fields:{handler(){this.$nextTick(()=>{this.calculateLabelWidths()})},deep:!0}},components:{Footer:n.A,ToggleDark:o.A,Logo:l.A},mounted(){this.initFormData(),this.initializeBackground(this.backgroundKey,".login",!this.isAdmin,!0),this.$nextTick(()=>{this.calculateLabelWidths()})},methods:{initFormData(){const e={};this.fields.forEach(t=>{e[t.key]=""}),this.formData=e,this.labelUnderlineWidths=new Array(this.fields.length).fill(0)},calculateLabelWidths(){this.$nextTick(()=>{this.fields.forEach((e,t)=>{const s=this.$refs[`inputLabel${t}`];if(s&&s[0]){const n=document.createElement("canvas"),a=n.getContext("2d"),i=s[0],l=window.getComputedStyle(i);a.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const o=a.measureText(e.label).width;this.labelUnderlineWidths[t]=Math.ceil(o)+3}})})},handleSubmit(){this.$emit("submit",{...this.formData})},handleInputFocus(e){const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.add("focused")}},handleInputBlur(e){const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.remove("focused")}}}},k=s(1241);const w=(0,k.A)(y,[["render",f],["__scopeId","data-v-61197d6f"]]);var v=w},8351:function(e,t,s){s.r(t),s.d(t,{default:function(){return u}});var n=s(4452),a=s(6768);function i(e,t,s,i,l,o){const r=n.A;return(0,a.uX)(),(0,a.Wv)(r,{title:"管理端登录",fields:l.loginFields,"submit-text":"登录","background-key":"adminLoginBkImg","is-admin":!0,onSubmit:o.handleLogin},null,8,["fields","onSubmit"])}s(4114),s(4979);var l=s(9189),o={data(){return{loginFields:[{key:"username",label:"用户名",placeholder:"请输入用户名",type:"text"},{key:"password",label:"密码",placeholder:"请输入密码",type:"password",showPassword:!0}]}},components:{BaseLogin:n.A},methods:{async handleLogin(e){const{username:t,password:s}=e,n=btoa(`${t}:${s}`);try{const e=await l.A.get("/api/manage/check",{headers:{Authorization:`Basic ${n}`},withCredentials:!0});200===e.status&&(this.$store.commit("setCredentials",n),this.$router.push("/dashboard"))}catch(a){a.response&&401===a.response.status?this.$message.error("用户名或密码错误"):this.$message.error("服务器错误")}}}},r=s(1241);const d=(0,r.A)(o,[["render",i]]);var u=d}}]);
//# sourceMappingURL=548.872506ac.js.map