mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 00:53:20 +08:00
Feat:美化登录页面显示效果
This commit is contained in:
1
css/107.70b00c2a.css
Normal file
1
css/107.70b00c2a.css
Normal file
File diff suppressed because one or more lines are too long
BIN
css/107.70b00c2a.css.gz
Normal file
BIN
css/107.70b00c2a.css.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
1
css/86.70b00c2a.css
Normal file
1
css/86.70b00c2a.css
Normal file
File diff suppressed because one or more lines are too long
BIN
css/86.70b00c2a.css.gz
Normal file
BIN
css/86.70b00c2a.css.gz
Normal file
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><link rel="apple-touch-icon" href="/logo.png"><link rel="mask-icon" href="/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/app.c07687cf.js"></script><link href="/css/app.cdb36a94.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html><style>/* 下拉菜单样式 */
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><link rel="apple-touch-icon" href="/logo.png"><link rel="mask-icon" href="/logo.png" color="#f4b400"><meta name="description" content="Sanyue ImgHub - A modern file hosting platform"><meta name="keywords" content="Sanyue, ImgHub, file hosting, image hosting, cloud storage"><meta name="author" content="SanyueQi"><title>Sanyue ImgHub</title><script defer="defer" src="/js/app.12fe8dd8.js"></script><link href="/css/app.cdb36a94.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html><style>/* 下拉菜单样式 */
|
||||
.el-dropdown__popper.el-popper {
|
||||
border-radius: 12px;
|
||||
border: none;
|
||||
|
||||
BIN
index.html.gz
BIN
index.html.gz
Binary file not shown.
2
js/107.13efd48c.js
Normal file
2
js/107.13efd48c.js
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[107],{4208:function(e,t,s){s.d(t,{A:function(){return F}});var i=s(6975),n=s(47),o=(s(5331),s(9648),s(9623)),a=(s(6711),s(813)),l=(s(4896),s(4632)),r=s(4453),u=s(6768),d=s(4232),c=s(5130);const h={class:"login-container"},p={class:"login-title",tabindex:"0"},m={class:"input-wrapper"};function f(e,t,s,f,g,b){const y=r.A,k=l.A,w=a.tk,F=o.WK,v=n.S2,L=i.A;return(0,u.uX)(),(0,u.CE)("div",{class:(0,d.C4)(["login",{"is-focused":g.isFocused}])},[(0,u.bF)(y,{class:"toggle-dark"}),(0,u.bF)(k),(0,u.Lk)("div",h,[(0,u.Lk)("h1",p,(0,d.v_)(s.title),1),((0,u.uX)(!0),(0,u.CE)(u.FK,null,(0,u.pI)(s.fields,(e,t)=>((0,u.uX)(),(0,u.CE)("div",{key:e.key,class:"input-container"},[(0,u.Lk)("label",{class:"input-name",ref_for:!0,ref:`inputLabel${t}`,style:(0,d.Tr)({"--underline-width":g.labelUnderlineWidths[t]+"px"})},(0,d.v_)(e.label),5),(0,u.Lk)("div",m,[(0,u.bF)(F,{modelValue:g.formData[e.key],"onUpdate:modelValue":t=>g.formData[e.key]=t,placeholder:e.placeholder,type:e.type||"text","show-password":e.showPassword,class:"password-input",onKeyup:(0,c.jR)(b.handleSubmit,["enter","native"]),onFocus:b.handleInputFocus,onBlur:b.handleInputBlur},(0,u.eX)({_:2},[e.icon?{name:"prefix",fn:(0,u.k6)(()=>[(0,u.bF)(w,{class:"el-input__icon"},{default:(0,u.k6)(()=>[((0,u.uX)(),(0,u.Wv)((0,u.$y)(e.icon)))]),_:2},1024)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","placeholder","type","show-password","onKeyup","onFocus","onBlur"])])]))),128)),(0,u.bF)(v,{class:"submit",type:"primary",onClick:b.handleSubmit},{default:(0,u.k6)(()=>[(0,u.eW)((0,d.v_)(s.submitText),1)]),_:1},8,["onClick"])]),(0,u.bF)(L,{class:"footer"})],2)}s(8111),s(7588);var g=s(8401),b=s(8903),y={name:"BaseLogin",mixins:[b.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:[],isFocused:!1}},computed:{...(0,g.L8)(["userConfig"])},watch:{fields:{handler(){this.$nextTick(()=>{this.calculateLabelWidths()})},deep:!0}},components:{Footer:i.A,ToggleDark:r.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 i=document.createElement("canvas"),n=i.getContext("2d"),o=s[0],a=window.getComputedStyle(o);n.font=`${a.fontWeight} ${a.fontSize} ${a.fontFamily}`;const l=n.measureText(e.label).width;this.labelUnderlineWidths[t]=Math.ceil(l)+3}})})},handleSubmit(){this.$emit("submit",{...this.formData})},handleInputFocus(e){this.isFocused=!0;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.add("focused")}},handleInputBlur(e){this.isFocused=!1;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-75a6162e"]]);var F=w},9669:function(e,t,s){s.r(t),s.d(t,{default:function(){return p}});var i=s(4208),n=s(6768);function o(e,t,s,o,a,l){const r=i.A;return(0,n.uX)(),(0,n.Wv)(r,{title:l.loginTitle,fields:a.loginFields,"submit-text":"登录","background-key":"loginBkImg","is-admin":!1,onSubmit:l.handleLogin},null,8,["title","fields","onSubmit"])}s(4114);var a=s(4570),l=s.n(a),r=s(9189),u=s(8401),d={data(){return{loginFields:[{key:"password",label:"密码",placeholder:"请输入认证码",type:"password",showPassword:!0,icon:"Lock"}]}},computed:{...(0,u.L8)(["userConfig"]),ownerName(){return this.userConfig?.ownerName||"Sanyue"},loginTitle(){return`登录到 ${this.ownerName} 图床`}},components:{BaseLogin:i.A},methods:{handleLogin(e){const{password:t}=e,s=""===t?"unset":t;r.A.post("/api/login",{authCode:t}).then(e=>{200===e.status?(l().set("authCode",s,"14d"),this.$router.push("/"),this.$message.success("登录成功")):this.$message.error("登录失败,请检查密码是否正确")}).catch(e=>{this.$message.error("登录失败,请检查密码是否正确")})}}},c=s(1241);const h=(0,c.A)(d,[["render",o]]);var p=h}}]);
|
||||
//# sourceMappingURL=107.13efd48c.js.map
|
||||
BIN
js/107.13efd48c.js.gz
Normal file
BIN
js/107.13efd48c.js.gz
Normal file
Binary file not shown.
1
js/107.13efd48c.js.map
Normal file
1
js/107.13efd48c.js.map
Normal file
File diff suppressed because one or more lines are too long
BIN
js/107.13efd48c.js.map.gz
Normal file
BIN
js/107.13efd48c.js.map.gz
Normal file
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[45],{4893:function(e,t,s){s.d(t,{A:function(){return w}});var i=s(6975),n=s(47),a=(s(5331),s(9648),s(9623)),o=(s(6711),s(4632)),l=s(4453),r=s(6768),d=s(4232),u=s(5130);const c={class:"login-container"},h={class:"login-title",tabindex:"0"},p={class:"input-wrapper"};function m(e,t,s,m,f,b){const g=l.A,y=o.A,k=a.WK,w=n.S2,F=i.A;return(0,r.uX)(),(0,r.CE)("div",{class:(0,d.C4)(["login",{"is-focused":f.isFocused}])},[(0,r.bF)(g,{class:"toggle-dark"}),(0,r.bF)(y),(0,r.Lk)("div",c,[(0,r.Lk)("h1",h,(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":f.labelUnderlineWidths[s]+"px"})},(0,d.v_)(e.label),5),(0,r.Lk)("div",p,[(0,r.bF)(k,{modelValue:f.formData[e.key],"onUpdate:modelValue":t=>f.formData[e.key]=t,placeholder:e.placeholder,type:e.type||"text","show-password":e.showPassword,class:"password-input",onKeyup:(0,u.jR)(b.handleSubmit,["enter","native"]),onFocus:b.handleInputFocus,onBlur:b.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)(w,{class:"submit",type:"primary",onClick:b.handleSubmit},{default:(0,r.k6)(()=>[(0,r.eW)((0,d.v_)(s.submitText),1)]),_:1},8,["onClick"])]),(0,r.bF)(F,{class:"footer"})],2)}s(8111),s(7588);var f=s(8401),b=s(8903),g={name:"BaseLogin",mixins:[b.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:[],isFocused:!1}},computed:{...(0,f.L8)(["userConfig"])},watch:{fields:{handler(){this.$nextTick(()=>{this.calculateLabelWidths()})},deep:!0}},components:{Footer:i.A,ToggleDark:l.A,Logo:o.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 i=document.createElement("canvas"),n=i.getContext("2d"),a=s[0],o=window.getComputedStyle(a);n.font=`${o.fontWeight} ${o.fontSize} ${o.fontFamily}`;const l=n.measureText(e.label).width;this.labelUnderlineWidths[t]=Math.ceil(l)+3}})})},handleSubmit(){this.$emit("submit",{...this.formData})},handleInputFocus(e){this.isFocused=!0;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.add("focused")}},handleInputBlur(e){this.isFocused=!1;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.remove("focused")}}}},y=s(1241);const k=(0,y.A)(g,[["render",m],["__scopeId","data-v-06e63a14"]]);var w=k},8351:function(e,t,s){s.r(t),s.d(t,{default:function(){return u}});var i=s(4893),n=s(6768);function a(e,t,s,a,o,l){const r=i.A;return(0,n.uX)(),(0,n.Wv)(r,{title:"管理端登录",fields:o.loginFields,"submit-text":"登录","background-key":"adminLoginBkImg","is-admin":!0,onSubmit:l.handleLogin},null,8,["fields","onSubmit"])}s(4114),s(4979);var o=s(9189),l={data(){return{loginFields:[{key:"username",label:"用户名",placeholder:"请输入用户名",type:"text"},{key:"password",label:"密码",placeholder:"请输入密码",type:"password",showPassword:!0}]}},components:{BaseLogin:i.A},methods:{async handleLogin(e){const{username:t,password:s}=e,i=btoa(`${t}:${s}`);try{const e=await o.A.get("/api/manage/check",{headers:{Authorization:`Basic ${i}`},withCredentials:!0});200===e.status&&(this.$store.commit("setCredentials",i),this.$router.push("/dashboard"))}catch(n){n.response&&401===n.response.status?this.$message.error("用户名或密码错误"):this.$message.error("服务器错误")}}}},r=s(1241);const d=(0,r.A)(l,[["render",a]]);var u=d}}]);
|
||||
//# sourceMappingURL=45.17f632e5.js.map
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[472],{4893:function(e,t,s){s.d(t,{A:function(){return w}});var n=s(6975),i=s(47),a=(s(5331),s(9648),s(9623)),o=(s(6711),s(4632)),l=s(4453),r=s(6768),u=s(4232),d=s(5130);const c={class:"login-container"},h={class:"login-title",tabindex:"0"},p={class:"input-wrapper"};function m(e,t,s,m,f,g){const b=l.A,y=o.A,k=a.WK,w=i.S2,F=n.A;return(0,r.uX)(),(0,r.CE)("div",{class:(0,u.C4)(["login",{"is-focused":f.isFocused}])},[(0,r.bF)(b,{class:"toggle-dark"}),(0,r.bF)(y),(0,r.Lk)("div",c,[(0,r.Lk)("h1",h,(0,u.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,u.Tr)({"--underline-width":f.labelUnderlineWidths[s]+"px"})},(0,u.v_)(e.label),5),(0,r.Lk)("div",p,[(0,r.bF)(k,{modelValue:f.formData[e.key],"onUpdate:modelValue":t=>f.formData[e.key]=t,placeholder:e.placeholder,type:e.type||"text","show-password":e.showPassword,class:"password-input",onKeyup:(0,d.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)(w,{class:"submit",type:"primary",onClick:g.handleSubmit},{default:(0,r.k6)(()=>[(0,r.eW)((0,u.v_)(s.submitText),1)]),_:1},8,["onClick"])]),(0,r.bF)(F,{class:"footer"})],2)}s(8111),s(7588);var f=s(8401),g=s(8903),b={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:[],isFocused:!1}},computed:{...(0,f.L8)(["userConfig"])},watch:{fields:{handler(){this.$nextTick(()=>{this.calculateLabelWidths()})},deep:!0}},components:{Footer:n.A,ToggleDark:l.A,Logo:o.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"),i=n.getContext("2d"),a=s[0],o=window.getComputedStyle(a);i.font=`${o.fontWeight} ${o.fontSize} ${o.fontFamily}`;const l=i.measureText(e.label).width;this.labelUnderlineWidths[t]=Math.ceil(l)+3}})})},handleSubmit(){this.$emit("submit",{...this.formData})},handleInputFocus(e){this.isFocused=!0;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.add("focused")}},handleInputBlur(e){this.isFocused=!1;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.remove("focused")}}}},y=s(1241);const k=(0,y.A)(b,[["render",m],["__scopeId","data-v-06e63a14"]]);var w=k},9206:function(e,t,s){s.r(t),s.d(t,{default:function(){return p}});var n=s(4893),i=s(6768);function a(e,t,s,a,o,l){const r=n.A;return(0,i.uX)(),(0,i.Wv)(r,{title:l.loginTitle,fields:o.loginFields,"submit-text":"登录","background-key":"loginBkImg","is-admin":!1,onSubmit:l.handleLogin},null,8,["title","fields","onSubmit"])}s(4114);var o=s(4570),l=s.n(o),r=s(9189),u=s(8401),d={data(){return{loginFields:[{key:"password",label:"密码",placeholder:"请输入认证码",type:"password",showPassword:!0}]}},computed:{...(0,u.L8)(["userConfig"]),ownerName(){return this.userConfig?.ownerName||"Sanyue"},loginTitle(){return`登录到 ${this.ownerName} 图床`}},components:{BaseLogin:n.A},methods:{handleLogin(e){const{password:t}=e,s=""===t?"unset":t;r.A.post("/api/login",{authCode:t}).then(e=>{200===e.status?(l().set("authCode",s,"14d"),this.$router.push("/"),this.$message.success("登录成功")):this.$message.error("登录失败,请检查密码是否正确")}).catch(e=>{this.$message.error("登录失败,请检查密码是否正确")})}}},c=s(1241);const h=(0,c.A)(d,[["render",a]]);var p=h}}]);
|
||||
//# sourceMappingURL=472.2f8c843f.js.map
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
2
js/596.f153b5f9.js
Normal file
2
js/596.f153b5f9.js
Normal file
File diff suppressed because one or more lines are too long
BIN
js/596.f153b5f9.js.gz
Normal file
BIN
js/596.f153b5f9.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
js/596.f153b5f9.js.map.gz
Normal file
BIN
js/596.f153b5f9.js.map.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
2
js/597.edc42003.js
Normal file
2
js/597.edc42003.js
Normal file
File diff suppressed because one or more lines are too long
BIN
js/597.edc42003.js.gz
Normal file
BIN
js/597.edc42003.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
js/597.edc42003.js.map.gz
Normal file
BIN
js/597.edc42003.js.map.gz
Normal file
Binary file not shown.
2
js/86.ad2a296a.js
Normal file
2
js/86.ad2a296a.js
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[86],{412:function(e,t,s){s.r(t),s.d(t,{default:function(){return u}});var i=s(4208),n=s(6768);function a(e,t,s,a,o,l){const r=i.A;return(0,n.uX)(),(0,n.Wv)(r,{title:"管理端登录",fields:o.loginFields,"submit-text":"登录","background-key":"adminLoginBkImg","is-admin":!0,onSubmit:l.handleLogin},null,8,["fields","onSubmit"])}s(4114),s(4979);var o=s(9189),l={data(){return{loginFields:[{key:"username",label:"用户名",placeholder:"请输入用户名",type:"text",icon:"User"},{key:"password",label:"密码",placeholder:"请输入密码",type:"password",showPassword:!0,icon:"Lock"}]}},components:{BaseLogin:i.A},methods:{async handleLogin(e){const{username:t,password:s}=e,i=btoa(`${t}:${s}`);try{const e=await o.A.get("/api/manage/check",{headers:{Authorization:`Basic ${i}`},withCredentials:!0});200===e.status&&(this.$store.commit("setCredentials",i),this.$router.push("/dashboard"))}catch(n){n.response&&401===n.response.status?this.$message.error("用户名或密码错误"):this.$message.error("服务器错误")}}}},r=s(1241);const d=(0,r.A)(l,[["render",a]]);var u=d},4208:function(e,t,s){s.d(t,{A:function(){return F}});var i=s(6975),n=s(47),a=(s(5331),s(9648),s(9623)),o=(s(6711),s(813)),l=(s(4896),s(4632)),r=s(4453),d=s(6768),u=s(4232),c=s(5130);const h={class:"login-container"},p={class:"login-title",tabindex:"0"},m={class:"input-wrapper"};function f(e,t,s,f,b,g){const y=r.A,k=l.A,w=o.tk,F=a.WK,v=n.S2,L=i.A;return(0,d.uX)(),(0,d.CE)("div",{class:(0,u.C4)(["login",{"is-focused":b.isFocused}])},[(0,d.bF)(y,{class:"toggle-dark"}),(0,d.bF)(k),(0,d.Lk)("div",h,[(0,d.Lk)("h1",p,(0,u.v_)(s.title),1),((0,d.uX)(!0),(0,d.CE)(d.FK,null,(0,d.pI)(s.fields,(e,t)=>((0,d.uX)(),(0,d.CE)("div",{key:e.key,class:"input-container"},[(0,d.Lk)("label",{class:"input-name",ref_for:!0,ref:`inputLabel${t}`,style:(0,u.Tr)({"--underline-width":b.labelUnderlineWidths[t]+"px"})},(0,u.v_)(e.label),5),(0,d.Lk)("div",m,[(0,d.bF)(F,{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,c.jR)(g.handleSubmit,["enter","native"]),onFocus:g.handleInputFocus,onBlur:g.handleInputBlur},(0,d.eX)({_:2},[e.icon?{name:"prefix",fn:(0,d.k6)(()=>[(0,d.bF)(w,{class:"el-input__icon"},{default:(0,d.k6)(()=>[((0,d.uX)(),(0,d.Wv)((0,d.$y)(e.icon)))]),_:2},1024)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","placeholder","type","show-password","onKeyup","onFocus","onBlur"])])]))),128)),(0,d.bF)(v,{class:"submit",type:"primary",onClick:g.handleSubmit},{default:(0,d.k6)(()=>[(0,d.eW)((0,u.v_)(s.submitText),1)]),_:1},8,["onClick"])]),(0,d.bF)(L,{class:"footer"})],2)}s(8111),s(7588);var b=s(8401),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:[],isFocused:!1}},computed:{...(0,b.L8)(["userConfig"])},watch:{fields:{handler(){this.$nextTick(()=>{this.calculateLabelWidths()})},deep:!0}},components:{Footer:i.A,ToggleDark:r.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 i=document.createElement("canvas"),n=i.getContext("2d"),a=s[0],o=window.getComputedStyle(a);n.font=`${o.fontWeight} ${o.fontSize} ${o.fontFamily}`;const l=n.measureText(e.label).width;this.labelUnderlineWidths[t]=Math.ceil(l)+3}})})},handleSubmit(){this.$emit("submit",{...this.formData})},handleInputFocus(e){this.isFocused=!0;const t=e.target.closest(".input-container");if(t){const e=t.querySelector(".input-wrapper");e&&e.classList.add("focused")}},handleInputBlur(e){this.isFocused=!1;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-75a6162e"]]);var F=w}}]);
|
||||
//# sourceMappingURL=86.ad2a296a.js.map
|
||||
BIN
js/86.ad2a296a.js.gz
Normal file
BIN
js/86.ad2a296a.js.gz
Normal file
Binary file not shown.
1
js/86.ad2a296a.js.map
Normal file
1
js/86.ad2a296a.js.map
Normal file
File diff suppressed because one or more lines are too long
BIN
js/86.ad2a296a.js.map.gz
Normal file
BIN
js/86.ad2a296a.js.map.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
js/app.12fe8dd8.js.gz
Normal file
BIN
js/app.12fe8dd8.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
js/app.12fe8dd8.js.map.gz
Normal file
BIN
js/app.12fe8dd8.js.map.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
1902
package-lock.json
generated
1902
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user