20260905172534

This commit is contained in:
oneao committed 2026-09-05 17:25:35 +08:00
1 parent 1b01a31252
commit 7b00eeb88c
711 files changed
+2849 -959

No files matched your search

@@ -0,0 +1 @@
import{$ as e,B as t,C as n,Ht as r,J as i,Lt as a,M as o,Q as s,R as c,T as l,U as u,V as d,_ as f,b as p,gt as m,it as h,lt as g,t as _,ut as v,v as y,w as b,wt as x,x as S,y as C,zt as w}from"./_plugin-vue_export-helper-Ktpf6lZe.js";import{h as T,m as E}from"./useApi-CROJJdhE-BKbQ20nt.js";import{n as D}from"./app-BeHz6434.js";import{D as O,J as k,U as A,_ as j,g as M,t as N,y as P}from"./ui-BhP3ZSBa.js";import{n as F,t as I}from"./key-round-ClmJfynH.js";import{n as L,r as R,t as z}from"./user-D5GR1UC5.js";import{i as B,l as V}from"./api-BHfsXASe.js";x(),o(),h();var H=_({__name:`SliderCaptcha`,props:{modelValue:{type:Boolean,default:!1},text:{type:String,default:`请按住滑块拖动`},successText:{type:String,default:`验证通过`},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`success`,`start`,`move`,`end`],setup(e,{expose:n,emit:i}){let o=e,l=i,f=v(null),p=v(null),h=v(null),g=v(!1),_=v(!1),b=v(0),x=v(0),T=v(!1),E=v(`0`),D=v(`0`);s(()=>o.modelValue,e=>{e!==_.value&&(_.value=!!e)}),s(_,e=>{e&&l(`success`,{isPassing:!0})});function O(e){return`pageX`in e?e.pageX:`touches`in e&&e.touches[0]?e.touches[0].pageX:0}function j(){let e=f.value,t=p.value;if(!e||!t)return{actionWidth:40,offset:0,wrapperWidth:220};let n=e.offsetWidth,r=t.offsetWidth;return{actionWidth:r,offset:n-r-6,wrapperWidth:n}}function M(e){if(_.value||o.disabled)return;b.value=O(e);let t=Number.parseInt(E.value||`0`,10);x.value=b.value-t,g.value=!0,l(`start`,e)}function N(e){if(!g.value||_.value)return;let t=p.value,n=h.value;if(!t||!n)return;let{actionWidth:r,offset:i,wrapperWidth:a}=j(),o=O(e)-x.value;l(`move`,{event:e,moveDistance:x.value,moveX:o}),o>=i-2?(E.value=`${a-r}px`,D.value=`${a-r/2}px`,I()):o>0?(E.value=`${o}px`,D.value=`${o+r/2}px`):(E.value=`0`,D.value=`0`)}function P(e){g.value&&F(e)}function F(e){if(!g.value||_.value)return;l(`end`,e);let t=p.value,n=h.value;if(!t||!n)return;let{actionWidth:r,offset:i,wrapperWidth:a}=j();O(e)-x.value>=i-2?(E.value=`${a-r}px`,D.value=`${a-r/2}px`,I()):L(),g.value=!1}function I(){_.value=!0,g.value=!1,l(`update:modelValue`,!0)}function L(){g.value=!1,_.value=!1,x.value=0,l(`update:modelValue`,!1),T.value=!0,c(()=>{E.value=`0`,D.value=`0`,setTimeout(()=>{T.value=!1},300)})}return d(()=>{document.addEventListener(`mouseup`,P),document.addEventListener(`touchend`,P)}),t(()=>{document.removeEventListener(`mouseup`,P),document.removeEventListener(`touchend`,P)}),n({resume:L}),(t,n)=>(u(),S(`div`,{ref_key:`wrapperRef`,ref:f,class:a([`scaptcha`,{"scaptcha--disabled":e.disabled,"scaptcha--passed":_.value}]),onMousemove:N,onTouchmove:N},[y(`div`,{ref_key:`barRef`,ref:h,class:a([`scaptcha__bar`,{"scaptcha__bar--left":T.value,"scaptcha__bar--passed":_.value}]),style:w({width:D.value})},null,6),y(`div`,{class:a([`scaptcha__text`,{"scaptcha__text--passed":_.value}])},r(_.value?e.successText:e.text),3),y(`div`,{ref_key:`actionRef`,ref:p,class:a([`scaptcha__action`,{"scaptcha__action--left":T.value,"scaptcha__action--disabled":e.disabled,"scaptcha__action--passed":_.value}]),style:w({left:E.value}),onMousedown:M,onTouchstart:M},[_.value?(u(),C(m(k),{key:1,size:16})):(u(),C(m(A),{key:0,size:16}))],38)],34))}},[[`__scopeId`,`data-v-f1216faa`]]);o(),x(),h();var U={class:`login-page`},W={class:`login-actions`},G={class:`login-body`},K={class:`login-right`},q={class:`login-card`},J={key:0,class:`login-hint`,role:`alert`},Y=_({__name:`index`,setup(t){let a=T(),o=E(),s=V(),c=D(),h=f(()=>{let e=String(o.query.reason||``);return e===`session-replaced`?`账号已在其他设备登录,请重新登录`:e===`expired`?`登录已过期,请重新登录`:``}),_=g({orgId:``,account:``,password:``,captcha:!1}),x={orgId:[{required:!0,message:`请输入机构码`}],account:[{required:!0,message:`请输入账号`}],captcha:[{validator:e=>e===!0,message:`请完成滑块验证`}]},w=v(!1),k=v(null),A=f(()=>c.darkMode);function Y(){c.toggleDarkMode()}let X=v(`zh-CN`);function Z(){X.value=X.value===`zh-CN`?`en-US`:`zh-CN`,N.info(`语言切换待接入 i18n 后生效`)}d(()=>{_.orgId=s.userInfo.orgId||``,_.account=s.userInfo.account||``,_.password=``,document.querySelector(`#orgId input`)?.focus()});async function Q(e){w.value=!0;try{let t=await B(e.orgId,e.account,e.password??``);s.setSession({token:t.data.token,user:{...t.data.user}},t.data.orgid??e.orgId),s.saveLastLogin(e.orgId,e.account),N.success(`登录成功`),a.replace(String(o.query.redirect||`/dashboard`))}catch(e){e?.toasted||N.error(e.message||`登录失败,请稍后重试`),k.value?.resume?.()}finally{w.value=!1}}function $(){N.warning(`请填写完整的登录信息`)}return(t,a)=>(u(),S(`div`,U,[a[9]||=y(`div`,{class:`login-brand`},[y(`img`,{src:`/favicon.svg`,alt:`FMS`,class:`login-logo__img`}),y(`span`,{class:`login-brand__name`},`FMS 企业管理系统`)],-1),y(`div`,W,[l(m(O),{type:`ghost`,size:`small`,class:`login-action-btn`,onClick:Z},{default:e(()=>[b(r(X.value===`zh-CN`?`中`:`EN`),1)]),_:1}),l(m(O),{type:`ghost`,size:`small`,class:`lo Line truncated