@robot-admin/naive-ui-components 0.37.1 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +24 -3
- package/README_EN.md +23 -2
- package/dist/C_AntV.css +30 -30
- package/dist/C_AudioPlayer.css +4 -4
- package/dist/C_Captcha.css +31 -19
- package/dist/C_Captcha.d.ts +1 -1
- package/dist/C_DataPicker.d.ts +0 -1
- package/dist/C_Density2.cjs +1 -1
- package/dist/C_Density2.js +1 -1
- package/dist/C_FilePreview.css +1 -1
- package/dist/C_Form.base.css +61 -58
- package/dist/C_Form.css +61 -58
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +2 -1
- package/dist/C_FormModal.d.ts +2 -1
- package/dist/C_FormSearch.d.ts +2 -2
- package/dist/C_GlobalSearch.css +12 -12
- package/dist/C_Guide.css +6 -6
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Login.css +139 -112
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_NotificationCenter.css +91 -91
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_Table.base.css +231 -212
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +170 -154
- package/dist/C_Table.d.cts +2 -1
- package/dist/C_Table.d.ts +2 -3
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +4 -4
- package/dist/C_Table2.js +4 -4
- package/dist/C_Timeline.css +2 -2
- package/dist/C_Tree.d.cts +1 -0
- package/dist/C_Tree.d.ts +0 -1
- package/dist/C_UserPicker.d.ts +0 -1
- package/dist/C_VideoPlayer.css +26 -26
- package/dist/C_VideoPlayer2.cjs +1 -1
- package/dist/C_VideoPlayer2.js +1 -1
- package/dist/C_VtableGantt.css +34 -32
- package/dist/C_WorkFlow.css +35 -35
- package/dist/C_WorkFlow.d.ts +0 -1
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/UML.cjs +1 -1
- package/dist/UML.js +1 -1
- package/dist/component-config.d.ts +1723 -2
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.ts +4 -3
- package/dist/config.js +1 -1
- package/dist/constants3.d.cts +5 -5
- package/dist/constants3.d.ts +5 -5
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/context.cjs +1 -1
- package/dist/context.d.cts +1118 -3
- package/dist/context.js +1 -1
- package/dist/data2.d.cts +3 -3
- package/dist/data2.d.ts +3 -3
- package/dist/dateRange.d.ts +1 -1
- package/dist/editors.d.cts +9 -7
- package/dist/editors.d.ts +9 -7
- package/dist/graphics.cjs +1 -1
- package/dist/graphics.d.cts +0 -45
- package/dist/graphics.d.ts +0 -45
- package/dist/graphics.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.ts +5 -5
- package/dist/index11.vue.d.cts +5 -5
- package/dist/index11.vue.d.ts +4 -4
- package/dist/index12.vue.d.cts +4 -4
- package/dist/index13.vue.d.ts +2 -2
- package/dist/index14.vue.d.cts +2 -2
- package/dist/index15.vue.d.ts +1 -1
- package/dist/index16.vue.d.cts +1 -1
- package/dist/index16.vue.d.ts +3 -3
- package/dist/index17.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +6 -6
- package/dist/index18.vue.d.cts +6 -6
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index20.vue.d.cts +1 -1
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index28.vue.d.cts +2 -2
- package/dist/index28.vue.d.ts +2 -2
- package/dist/index3.vue.d.cts +2 -2
- package/dist/index3.vue.d.ts +2 -2
- package/dist/index30.vue.d.cts +1 -1
- package/dist/index30.vue.d.ts +1 -1
- package/dist/index31.vue.d.cts +2 -2
- package/dist/index31.vue.d.ts +2 -2
- package/dist/index32.vue.d.cts +2 -2
- package/dist/index32.vue.d.ts +2 -2
- package/dist/index4.vue.d.cts +2 -2
- package/dist/index4.vue.d.ts +2 -2
- package/dist/index8.vue.d.ts +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +612 -564
- package/dist/theme.cjs +1 -1
- package/dist/theme.d.cts +27 -8
- package/dist/theme.d.ts +27 -8
- package/dist/theme.js +1 -1
- package/dist/theme2.cjs +1 -1
- package/dist/theme2.js +1 -1
- package/dist/types3.d.ts +5 -1119
- package/dist/types4.d.cts +5 -1119
- package/dist/types6.d.ts +2 -1
- package/dist/types7.d.cts +2 -1
- package/dist/useCalendarEvents.d.cts +2 -2
- package/dist/useCalendarEvents.d.ts +2 -2
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentTheme.cjs +1 -1
- package/dist/useComponentTheme.js +1 -1
- package/dist/useCropperCore.d.cts +8 -8
- package/dist/useCropperCore.d.ts +8 -8
- package/dist/useDynamicFormState.d.cts +1 -1
- package/dist/useDynamicFormState.d.ts +1 -1
- package/dist/useEdgeInteraction.d.cts +1 -1
- package/dist/useEdgeInteraction.d.ts +1 -1
- package/dist/useFormRenderer.d.cts +1 -1
- package/dist/useFormRenderer.d.ts +1 -1
- package/dist/useGlobalSearch.d.cts +1 -1
- package/dist/useGlobalSearch.d.ts +1 -1
- package/dist/useInfiniteScroll.d.cts +4 -4
- package/dist/useInfiniteScroll.d.ts +4 -4
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +3 -3
- package/dist/useSignatureHistory.d.ts +3 -3
- package/dist/useSplitResize.d.cts +3 -3
- package/dist/useSplitResize.d.ts +3 -3
- package/dist/verification.d.cts +7 -7
- package/dist/verification.d.ts +7 -7
- package/docs/guides/table-density.md +19 -2
- package/docs/guides/theme.md +44 -2
- package/package.json +2 -1
- package/dist/context.d.ts +0 -610
- package/dist/useTableGlobalConfig.cjs +0 -1
- package/dist/useTableGlobalConfig.js +0 -1
package/dist/C_Login.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./types.js";
|
|
2
2
|
import "./component-config.js";
|
|
3
3
|
import "./verification.js";
|
|
4
4
|
import { a as LoginFeatures, c as RegisterFormData, i as DEFAULT_SOCIAL_PROVIDERS, l as SocialProvider, n as CaptchaFormData, o as LoginProps, r as DEFAULT_FEATURES, s as PasswordFormData, t as _default } from "./index20.vue.js";
|
package/dist/C_Login2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./export-helper.cjs`),t=require(`./C_Icon2.cjs`),n=require(`./C_Captcha2.cjs`),r=require(`./useActionTask.cjs`),i=require(`./storage.cjs`),a=require(`./C_QRCode2.cjs`);let o=require(`vue`),s=require(`naive-ui`);const c=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],l={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},ee={class:`c-login-panel`},te={class:`c-login__header`},ne={key:0,class:`c-login__logo`},re={class:`c-login__title`},ie={key:0,class:`c-login__subtitle`},ae={key:1,class:`c-login__subtitle c-login__subtitle--register`},oe={key:0,class:`c-login__aux-row`},se={class:`c-login__code-row`},u={key:0,class:`c-login__captcha-wrap`},d={key:3,class:`c-login__qr-panel`},ce={class:`c-login__qr-frame`},le={key:1,class:`c-login__qr-placeholder`},f={key:2,class:`c-login__qr-scan-line`},p={class:`c-login__qr-hint`},ue={class:`c-login__code-row`},m={key:7,class:`c-login__mode-switch`},de={class:`c-login__social-row`},fe={key:9,class:`c-login__register-row`},h=(0,o.defineComponent)({__name:`index`,props:{title:{default:`欢迎回来`},subtitle:{},logoIcon:{},features:{},socialProviders:{},qrcodeUrl:{},storageKey:{default:`c_login_remember`},loading:{type:Boolean,default:!1},submitDisabled:{type:Boolean},defaultUsername:{default:``},defaultPassword:{default:``},captchaVerifier:{},captchaProvider:{default:`puzzle-captcha`},captchaChallengeUrl:{},requireCaptchaServerVerification:{type:Boolean,default:!1},captchaVerificationTimeout:{default:1e4}},emits:[`submit`,`captcha-submit`,`send-code`,`social-login`,`forgot-password`,`qrcode-refresh`,`register-submit`,`register-send-code`,`captcha-visible-change`,`username-change`],setup(e,{expose:h,emit:g}){let _=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},v=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],y=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,b=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,x=e,S=g,C=(0,o.computed)(()=>({...x,features:{...l,...x.features},socialProviders:x.socialProviders??c})),w=(0,o.computed)(()=>C.value.features),T=(0,o.computed)(()=>C.value.socialProviders),E=(0,o.ref)(`password`),D=r.t(),O=(0,o.computed)(()=>D.isRunning(E.value)),k=!1,A=0;(0,o.watch)(E,()=>A++,{flush:`sync`});let j=e=>!k&&E.value===e&&!x.loading&&!x.submitDisabled&&(e!==`password`||!w.value.captchaVerify||H.value);async function M(e,t,n,r){await D.run(e,async()=>{let i=t.value;if(!i)return;let a=A,o={...n};try{await i.validate()}catch{return}!j(e)||a!==A||i!==t.value||!Object.keys(o).every(e=>o[e]===n[e])||r(o)},()=>j(e))}let N=(0,o.ref)(null),P=(0,o.reactive)({username:x.defaultUsername??``,password:x.defaultPassword??``}),pe={username:[{required:!0,message:_(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:_(`cl_password_rule`,`请输入密码`),trigger:`blur`}]};(0,o.watch)(()=>P.username,e=>S(`username-change`,e),{immediate:!0,flush:`sync`});let F=(0,o.ref)(!1);(0,o.watch)([F,()=>P.username],([e])=>{e?i.i(x.storageKey,{username:P.username}):i.r(x.storageKey)}),(0,o.onMounted)(()=>{let e=i.t(x.storageKey);typeof e?.username==`string`&&(P.username=e.username,F.value=!0)});let I=()=>M(`password`,N,P,e=>{S(`submit`,{...e,...H.value?{captchaToken:U.value,captchaTimestamp:W.value,captchaType:G.value,captchaVerifiedBy:K.value}:{}})}),L=(0,o.ref)(null),R=(0,o.reactive)({account:``,code:``}),z=(0,o.ref)(0),B=null,me={account:v(`手机号`,y,`手机号格式错误`),code:[{required:!0,message:_(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},V=(0,o.ref)(),H=(0,o.ref)(!1),U=(0,o.ref)(``),W=(0,o.ref)(0),G=(0,o.ref)(`puzzle-captcha`),K=(0,o.ref)(),he=e=>{H.value=!0,U.value=e.token,W.value=e.timestamp,G.value=e.type,K.value=e.verifiedBy},ge=()=>{H.value=!1},_e=e=>{H.value=e,e||(U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0)},ve=()=>{H.value=!1,U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0,V.value?.reset()},q=()=>M(`captcha`,L,R,e=>S(`captcha-submit`,e)),ye=()=>{let e=R.account.trim();z.value>0||!y.test(e)||(S(`send-code`,e),B&&=(clearInterval(B),null),z.value=60,B=setInterval(()=>{z.value--,z.value<=0&&(clearInterval(B),B=null)},1e3))},J=(0,o.computed)(()=>x.qrcodeUrl?.trim()??``),be=()=>{S(`qrcode-refresh`)},Y=(0,o.ref)(null),X=(0,o.reactive)({phone:``,code:``,password:``,confirmPassword:``}),Z=(0,o.ref)(0),Q=null,xe={phone:v(`手机号`,y,`手机号格式错误`),code:[{required:!0,message:_(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:v(`密码`,b,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:_(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===X.password?!0:Error(_(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},Se=()=>{let e=X.phone.trim();Z.value>0||!y.test(e)||(S(`register-send-code`,e),Q&&=(clearInterval(Q),null),Z.value=60,Q=setInterval(()=>{Z.value--,Z.value<=0&&(clearInterval(Q),Q=null)},1e3))},$=()=>M(`register`,Y,X,e=>S(`register-submit`,e));return(0,o.onUnmounted)(()=>{k=!0,B&&=(clearInterval(B),null),Q&&=(clearInterval(Q),null)}),h({resetCaptcha:ve}),(e,r)=>{let i=s.NInput,c=s.NFormItem,l=s.NCheckbox,h=s.NText,g=s.NForm,v=s.NButton,y=s.NDivider,b=s.NTooltip;return(0,o.openBlock)(),(0,o.createElementBlock)(`div`,ee,[(0,o.createCommentVNode)(` ===== Logo / 标题区 ===== `),(0,o.createElementVNode)(`div`,te,[(0,o.renderSlot)(e.$slots,`logo`,{},()=>[C.value.logoIcon?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,ne,[(0,o.createVNode)(t.t,{name:C.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):(0,o.createCommentVNode)(`v-if`,!0)],!0),(0,o.createElementVNode)(`h2`,re,(0,o.toDisplayString)(C.value.title),1),C.value.subtitle&&E.value!==`register`?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,ie,(0,o.toDisplayString)(C.value.subtitle),1)):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` 注册视图的副标题 `),E.value===`register`?((0,o.openBlock)(),(0,o.createElementBlock)(`p`,ae,(0,o.toDisplayString)(_(`cl_register`,`注册账号`)),1)):(0,o.createCommentVNode)(`v-if`,!0)]),(0,o.createCommentVNode)(` ===== 密码登录表单(默认视图) ===== `),(0,o.withDirectives)((0,o.createVNode)(g,{ref_key:`passwordFormRef`,ref:N,model:P,rules:pe,class:`c-login__form`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{path:`username`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:P.username,"onUpdate:value":r[0]||=e=>P.username=e,disabled:x.loading,placeholder:_(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,o.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:P.password,"onUpdate:value":r[1]||=e=>P.password=e,disabled:x.loading,type:`password`,"show-password-on":`click`,placeholder:_(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:(0,o.withKeys)(I,[`enter`])},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,o.createCommentVNode)(` 宿主扩展字段只获得账号与忙碌状态,不暴露密码。 `),(0,o.renderSlot)(e.$slots,`password-fields`,{username:P.username,loading:x.loading||O.value},void 0,!0),(0,o.createCommentVNode)(` 记住我 + 忘记密码 `),w.value.rememberMe||w.value.forgotPassword?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,oe,[w.value.rememberMe?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,checked:F.value,"onUpdate:checked":r[2]||=e=>F.value=e,class:`c-login__remember`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):(0,o.createCommentVNode)(`v-if`,!0),w.value.forgotPassword?((0,o.openBlock)(),(0,o.createBlock)(h,{key:1,class:`c-login__forgot`,onClick:r[3]||=e=>S(`forgot-password`)},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_forgot`,`忘记密码?`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0)])):(0,o.createCommentVNode)(`v-if`,!0)]),_:3},8,[`model`]),[[o.vShow,E.value===`password`]]),(0,o.createCommentVNode)(` ===== 验证码登录表单 ===== `),(0,o.withDirectives)((0,o.createVNode)(g,{ref_key:`captchaFormRef`,ref:L,model:R,rules:me,class:`c-login__form`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{path:`account`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:R.account,"onUpdate:value":r[4]||=e=>R.account=e,placeholder:_(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,o.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`div`,se,[(0,o.createVNode)(i,{value:R.code,"onUpdate:value":r[5]||=e=>R.code=e,placeholder:_(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:(0,o.withKeys)(q,[`enter`])},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,o.createVNode)(v,{disabled:z.value>0||!R.account,class:`c-login__send-code-btn`,onClick:ye},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(z.value>0?`${z.value}s ${_(`cl_resend`,`后重发`)}`:_(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[o.vShow,E.value===`captcha`]]),(0,o.createCommentVNode)(` ===== 人机验证拼图(仅密码登录模式) ===== `),w.value.captchaVerify&&E.value===`password`?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,u,[(0,o.createVNode)(n.t,{ref_key:`captchaRef`,ref:V,theme:`dark`,provider:x.captchaProvider,"challenge-url":x.captchaChallengeUrl,verifier:x.captchaVerifier,"require-server-verification":x.requireCaptchaServerVerification,"verification-timeout":x.captchaVerificationTimeout,onSuccess:he,onFail:ge,onChange:_e,onVisibleChange:r[6]||=e=>S(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 登录按钮(密码和验证码模式) ===== `),E.value===`password`||E.value===`captcha`?((0,o.openBlock)(),(0,o.createBlock)(v,{key:1,type:`primary`,block:``,loading:x.loading||O.value,disabled:x.loading||O.value||x.submitDisabled||E.value===`password`&&w.value.captchaVerify&&!H.value,class:`c-login__submit-btn`,onClick:r[7]||=e=>E.value===`password`?I():q()},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(E.value===`password`&&w.value.captchaVerify&&!H.value?_(`cl_verify_first`,`请先完成人机验证`):_(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 返回按钮(验证码子视图) ===== `),E.value===`captcha`?((0,o.openBlock)(),(0,o.createBlock)(v,{key:2,block:``,class:`c-login__back-btn`,onClick:r[8]||=e=>E.value=`password`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_back`,`返回`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 扫码登录面板 ===== `),E.value===`qrcode`?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,d,[(0,o.createElementVNode)(`div`,ce,[J.value?((0,o.openBlock)(),(0,o.createBlock)(a.t,{key:0,value:J.value,size:148,margin:1,"show-border":!1,color:`#ffffff`,"bg-color":`#000000`,"error-correction-level":`M`},null,8,[`value`])):((0,o.openBlock)(),(0,o.createElementBlock)(`div`,le,(0,o.toDisplayString)(_(`cl_qr_missing`,`请配置二维码地址`)),1)),J.value?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,f)):(0,o.createCommentVNode)(`v-if`,!0),r[18]||=(0,o.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),r[19]||=(0,o.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),r[20]||=(0,o.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),r[21]||=(0,o.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),(0,o.createElementVNode)(`p`,p,[(0,o.createVNode)(t.t,{name:`mdi:cellphone-check`,size:13}),(0,o.createTextVNode)(` `+(0,o.toDisplayString)(_(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),(0,o.createVNode)(v,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:be},{icon:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:refresh`,size:12})]),default:(0,o.withCtx)(()=>[(0,o.createTextVNode)(` `+(0,o.toDisplayString)(_(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),E.value===`qrcode`?((0,o.openBlock)(),(0,o.createBlock)(v,{key:4,block:``,class:`c-login__back-btn`,onClick:r[9]||=e=>E.value=`password`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_back`,`返回`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 注册表单 ===== `),(0,o.withDirectives)((0,o.createVNode)(g,{ref_key:`registerFormRef`,ref:Y,model:X,rules:xe,class:`c-login__form`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{path:`phone`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:X.phone,"onUpdate:value":r[10]||=e=>X.phone=e,placeholder:_(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,o.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`div`,ue,[(0,o.createVNode)(i,{value:X.code,"onUpdate:value":r[11]||=e=>X.code=e,placeholder:_(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,o.createVNode)(v,{disabled:Z.value>0||!X.phone,class:`c-login__send-code-btn`,onClick:Se},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(Z.value>0?`${Z.value}s ${_(`cl_resend`,`后重发`)}`:_(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),(0,o.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:X.password,"onUpdate:value":r[12]||=e=>X.password=e,type:`password`,"show-password-on":`click`,placeholder:_(`cl_password_ph`,`请输入密码`)},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,o.createVNode)(c,{path:`confirmPassword`,class:`c-login__form-item`},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i,{value:X.confirmPassword,"onUpdate:value":r[13]||=e=>X.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:_(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:(0,o.withKeys)($,[`enter`])},{prefix:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[o.vShow,E.value===`register`]]),(0,o.createCommentVNode)(` ===== 注册确认按钮 ===== `),E.value===`register`?((0,o.openBlock)(),(0,o.createBlock)(v,{key:5,type:`primary`,block:``,loading:x.loading||O.value,disabled:x.loading||x.submitDisabled||O.value,class:`c-login__submit-btn`,onClick:$},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`,`disabled`])):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 注册视图返回按钮 ===== `),E.value===`register`?((0,o.openBlock)(),(0,o.createBlock)(v,{key:6,block:``,class:`c-login__back-btn`,onClick:r[14]||=e=>E.value=`password`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_back`,`返回`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),E.value===`password`&&(w.value.captchaLogin||w.value.qrcodeLogin)?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,m,[w.value.captchaLogin?((0,o.openBlock)(),(0,o.createBlock)(v,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:r[15]||=e=>E.value=`captcha`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0),w.value.qrcodeLogin?((0,o.openBlock)(),(0,o.createBlock)(v,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:r[16]||=e=>E.value=`qrcode`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_qr_login`,`扫码登录`)),1)]),_:1})):(0,o.createCommentVNode)(`v-if`,!0)])):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),E.value===`password`&&w.value.socialLogin&&T.value.length?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:8},[(0,o.createVNode)(y,{class:`c-login__divider`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_social_login`,`其他账号登录`)),1)]),_:1}),(0,o.createElementVNode)(`div`,de,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(T.value,e=>((0,o.openBlock)(),(0,o.createBlock)(b,{key:e.key,trigger:`hover`,placement:`top`},{trigger:(0,o.withCtx)(()=>[(0,o.createVNode)(v,{circle:``,class:`c-login__social-btn`,onClick:t=>S(`social-login`,e.key)},{icon:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{name:e.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:(0,o.withCtx)(()=>[(0,o.createTextVNode)(` `+(0,o.toDisplayString)(e.label),1)]),_:2},1024))),128))])],64)):(0,o.createCommentVNode)(`v-if`,!0),(0,o.createCommentVNode)(` ===== 注册入口(仅密码登录默认视图显示) ===== `),E.value===`password`&&w.value.register?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,fe,[(0,o.createVNode)(h,{class:`c-login__register-hint`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_no_account`,`还没有账号?`)),1)]),_:1}),(0,o.createVNode)(h,{class:`c-login__register-link`,onClick:r[17]||=e=>E.value=`register`},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(_(`cl_register`,`注册账号`)),1)]),_:1})])):(0,o.createCommentVNode)(`v-if`,!0)])}}});var g=e.t(h,[[`__scopeId`,`data-v-f404fc8e`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Icon2.cjs`),r=require(`./C_Captcha2.cjs`),i=require(`./useActionTask.cjs`),a=require(`./storage.cjs`),o=require(`./C_QRCode2.cjs`);let s=require(`vue`),c=require(`naive-ui`);const l=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],u={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},ee={class:`c-login__header`},te={key:0,class:`c-login__logo`},ne={class:`c-login__title`},re={key:0,class:`c-login__subtitle`},ie={key:1,class:`c-login__subtitle c-login__subtitle--register`},d={key:0,class:`c-login__aux-row`},ae={class:`c-login__code-row`},oe={key:0,class:`c-login__captcha-wrap`},se={key:3,class:`c-login__qr-panel`},ce={class:`c-login__qr-frame`},le={key:1,class:`c-login__qr-placeholder`},f={key:2,class:`c-login__qr-scan-line`},ue={class:`c-login__qr-hint`},p={class:`c-login__code-row`},m={key:7,class:`c-login__mode-switch`},de={class:`c-login__social-row`},h={key:9,class:`c-login__register-row`},g=(0,s.defineComponent)({__name:`index`,props:{title:{default:`欢迎回来`},subtitle:{},logoIcon:{},features:{},socialProviders:{},qrcodeUrl:{},storageKey:{default:`c_login_remember`},loading:{type:Boolean,default:!1},submitDisabled:{type:Boolean},defaultUsername:{default:``},defaultPassword:{default:``},captchaVerifier:{},captchaProvider:{default:`puzzle-captcha`},captchaChallengeUrl:{},requireCaptchaServerVerification:{type:Boolean,default:!1},captchaVerificationTimeout:{default:1e4}},emits:[`submit`,`captcha-submit`,`send-code`,`social-login`,`forgot-password`,`qrcode-refresh`,`register-submit`,`register-send-code`,`captcha-visible-change`,`username-change`],setup(t,{expose:g,emit:_}){let fe=e.n(),v=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},y=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],b=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,pe=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,x=t,S=_,C=(0,s.computed)(()=>({...x,features:{...u,...x.features},socialProviders:x.socialProviders??l})),w=(0,s.computed)(()=>C.value.features),T=(0,s.computed)(()=>C.value.socialProviders),E=(0,s.ref)(`password`),D=i.t(),O=(0,s.computed)(()=>D.isRunning(E.value)),k=!1,A=0;(0,s.watch)(E,()=>A++,{flush:`sync`});let j=e=>!k&&E.value===e&&!x.loading&&!x.submitDisabled&&(e!==`password`||!w.value.captchaVerify||H.value);async function M(e,t,n,r){await D.run(e,async()=>{let i=t.value;if(!i)return;let a=A,o={...n};try{await i.validate()}catch{return}!j(e)||a!==A||i!==t.value||!Object.keys(o).every(e=>o[e]===n[e])||r(o)},()=>j(e))}let N=(0,s.ref)(null),P=(0,s.reactive)({username:x.defaultUsername??``,password:x.defaultPassword??``}),me={username:[{required:!0,message:v(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:v(`cl_password_rule`,`请输入密码`),trigger:`blur`}]};(0,s.watch)(()=>P.username,e=>S(`username-change`,e),{immediate:!0,flush:`sync`});let F=(0,s.ref)(!1);(0,s.watch)([F,()=>P.username],([e])=>{e?a.i(x.storageKey,{username:P.username}):a.r(x.storageKey)}),(0,s.onMounted)(()=>{let e=a.t(x.storageKey);typeof e?.username==`string`&&(P.username=e.username,F.value=!0)});let I=()=>M(`password`,N,P,e=>{S(`submit`,{...e,...H.value?{captchaToken:U.value,captchaTimestamp:W.value,captchaType:G.value,captchaVerifiedBy:K.value}:{}})}),L=(0,s.ref)(null),R=(0,s.reactive)({account:``,code:``}),z=(0,s.ref)(0),B=null,he={account:y(`手机号`,b,`手机号格式错误`),code:[{required:!0,message:v(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},V=(0,s.ref)(),H=(0,s.ref)(!1),U=(0,s.ref)(``),W=(0,s.ref)(0),G=(0,s.ref)(`puzzle-captcha`),K=(0,s.ref)(),ge=e=>{H.value=!0,U.value=e.token,W.value=e.timestamp,G.value=e.type,K.value=e.verifiedBy},_e=()=>{H.value=!1},ve=e=>{H.value=e,e||(U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0)},ye=()=>{H.value=!1,U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0,V.value?.reset()},q=()=>M(`captcha`,L,R,e=>S(`captcha-submit`,e)),be=()=>{let e=R.account.trim();z.value>0||!b.test(e)||(S(`send-code`,e),B&&=(clearInterval(B),null),z.value=60,B=setInterval(()=>{z.value--,z.value<=0&&(clearInterval(B),B=null)},1e3))},J=(0,s.computed)(()=>x.qrcodeUrl?.trim()??``),xe=()=>{S(`qrcode-refresh`)},Y=(0,s.ref)(null),X=(0,s.reactive)({phone:``,code:``,password:``,confirmPassword:``}),Z=(0,s.ref)(0),Q=null,Se={phone:y(`手机号`,b,`手机号格式错误`),code:[{required:!0,message:v(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:y(`密码`,pe,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:v(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===X.password?!0:Error(v(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},Ce=()=>{let e=X.phone.trim();Z.value>0||!b.test(e)||(S(`register-send-code`,e),Q&&=(clearInterval(Q),null),Z.value=60,Q=setInterval(()=>{Z.value--,Z.value<=0&&(clearInterval(Q),Q=null)},1e3))},$=()=>M(`register`,Y,X,e=>S(`register-submit`,e));return(0,s.onUnmounted)(()=>{k=!0,B&&=(clearInterval(B),null),Q&&=(clearInterval(Q),null)}),g({resetCaptcha:ye}),(e,t)=>{let i=c.NInput,a=c.NFormItem,l=c.NCheckbox,u=c.NText,g=c.NForm,_=c.NButton,y=c.NDivider,b=c.NTooltip;return(0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:`c-login-panel`,style:(0,s.normalizeStyle)((0,s.unref)(fe))},[(0,s.createCommentVNode)(` ===== Logo / 标题区 ===== `),(0,s.createElementVNode)(`div`,ee,[(0,s.renderSlot)(e.$slots,`logo`,{},()=>[C.value.logoIcon?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,te,[(0,s.createVNode)(n.t,{name:C.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):(0,s.createCommentVNode)(`v-if`,!0)],!0),(0,s.createElementVNode)(`h2`,ne,(0,s.toDisplayString)(C.value.title),1),C.value.subtitle&&E.value!==`register`?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,re,(0,s.toDisplayString)(C.value.subtitle),1)):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` 注册视图的副标题 `),E.value===`register`?((0,s.openBlock)(),(0,s.createElementBlock)(`p`,ie,(0,s.toDisplayString)(v(`cl_register`,`注册账号`)),1)):(0,s.createCommentVNode)(`v-if`,!0)]),(0,s.createCommentVNode)(` ===== 密码登录表单(默认视图) ===== `),(0,s.withDirectives)((0,s.createVNode)(g,{ref_key:`passwordFormRef`,ref:N,model:P,rules:me,class:`c-login__form`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(a,{path:`username`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:P.username,"onUpdate:value":t[0]||=e=>P.username=e,disabled:x.loading,placeholder:v(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,s.createVNode)(a,{path:`password`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:P.password,"onUpdate:value":t[1]||=e=>P.password=e,disabled:x.loading,type:`password`,"show-password-on":`click`,placeholder:v(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:(0,s.withKeys)(I,[`enter`])},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,s.createCommentVNode)(` 宿主扩展字段只获得账号与忙碌状态,不暴露密码。 `),(0,s.renderSlot)(e.$slots,`password-fields`,{username:P.username,loading:x.loading||O.value},void 0,!0),(0,s.createCommentVNode)(` 记住我 + 忘记密码 `),w.value.rememberMe||w.value.forgotPassword?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,d,[w.value.rememberMe?((0,s.openBlock)(),(0,s.createBlock)(l,{key:0,checked:F.value,"onUpdate:checked":t[2]||=e=>F.value=e,class:`c-login__remember`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):(0,s.createCommentVNode)(`v-if`,!0),w.value.forgotPassword?((0,s.openBlock)(),(0,s.createBlock)(u,{key:1,class:`c-login__forgot`,onClick:t[3]||=e=>S(`forgot-password`)},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_forgot`,`忘记密码?`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0)])):(0,s.createCommentVNode)(`v-if`,!0)]),_:3},8,[`model`]),[[s.vShow,E.value===`password`]]),(0,s.createCommentVNode)(` ===== 验证码登录表单 ===== `),(0,s.withDirectives)((0,s.createVNode)(g,{ref_key:`captchaFormRef`,ref:L,model:R,rules:he,class:`c-login__form`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(a,{path:`account`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:R.account,"onUpdate:value":t[4]||=e=>R.account=e,placeholder:v(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,s.createVNode)(a,{path:`code`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,ae,[(0,s.createVNode)(i,{value:R.code,"onUpdate:value":t[5]||=e=>R.code=e,placeholder:v(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:(0,s.withKeys)(q,[`enter`])},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,s.createVNode)(_,{disabled:z.value>0||!R.account,class:`c-login__send-code-btn`,onClick:be},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(z.value>0?`${z.value}s ${v(`cl_resend`,`后重发`)}`:v(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[s.vShow,E.value===`captcha`]]),(0,s.createCommentVNode)(` ===== 人机验证拼图(仅密码登录模式) ===== `),w.value.captchaVerify&&E.value===`password`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,oe,[(0,s.createVNode)(r.t,{ref_key:`captchaRef`,ref:V,theme:`dark`,provider:x.captchaProvider,"challenge-url":x.captchaChallengeUrl,verifier:x.captchaVerifier,"require-server-verification":x.requireCaptchaServerVerification,"verification-timeout":x.captchaVerificationTimeout,onSuccess:ge,onFail:_e,onChange:ve,onVisibleChange:t[6]||=e=>S(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 登录按钮(密码和验证码模式) ===== `),E.value===`password`||E.value===`captcha`?((0,s.openBlock)(),(0,s.createBlock)(_,{key:1,type:`primary`,block:``,loading:x.loading||O.value,disabled:x.loading||O.value||x.submitDisabled||E.value===`password`&&w.value.captchaVerify&&!H.value,class:`c-login__submit-btn`,onClick:t[7]||=e=>E.value===`password`?I():q()},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(E.value===`password`&&w.value.captchaVerify&&!H.value?v(`cl_verify_first`,`请先完成人机验证`):v(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 返回按钮(验证码子视图) ===== `),E.value===`captcha`?((0,s.openBlock)(),(0,s.createBlock)(_,{key:2,block:``,class:`c-login__back-btn`,onClick:t[8]||=e=>E.value=`password`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_back`,`返回`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 扫码登录面板 ===== `),E.value===`qrcode`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,se,[(0,s.createElementVNode)(`div`,ce,[J.value?((0,s.openBlock)(),(0,s.createBlock)(o.t,{key:0,value:J.value,size:148,margin:1,"show-border":!1,color:`#ffffff`,"bg-color":`#000000`,"error-correction-level":`M`},null,8,[`value`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,le,(0,s.toDisplayString)(v(`cl_qr_missing`,`请配置二维码地址`)),1)),J.value?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,f)):(0,s.createCommentVNode)(`v-if`,!0),t[18]||=(0,s.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),t[19]||=(0,s.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),t[20]||=(0,s.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),t[21]||=(0,s.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),(0,s.createElementVNode)(`p`,ue,[(0,s.createVNode)(n.t,{name:`mdi:cellphone-check`,size:13}),(0,s.createTextVNode)(` `+(0,s.toDisplayString)(v(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),(0,s.createVNode)(_,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:xe},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:refresh`,size:12})]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)(v(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),E.value===`qrcode`?((0,s.openBlock)(),(0,s.createBlock)(_,{key:4,block:``,class:`c-login__back-btn`,onClick:t[9]||=e=>E.value=`password`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_back`,`返回`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 注册表单 ===== `),(0,s.withDirectives)((0,s.createVNode)(g,{ref_key:`registerFormRef`,ref:Y,model:X,rules:Se,class:`c-login__form`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(a,{path:`phone`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:X.phone,"onUpdate:value":t[10]||=e=>X.phone=e,placeholder:v(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,s.createVNode)(a,{path:`code`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,p,[(0,s.createVNode)(i,{value:X.code,"onUpdate:value":t[11]||=e=>X.code=e,placeholder:v(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,s.createVNode)(_,{disabled:Z.value>0||!X.phone,class:`c-login__send-code-btn`,onClick:Ce},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(Z.value>0?`${Z.value}s ${v(`cl_resend`,`后重发`)}`:v(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),(0,s.createVNode)(a,{path:`password`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:X.password,"onUpdate:value":t[12]||=e=>X.password=e,type:`password`,"show-password-on":`click`,placeholder:v(`cl_password_ph`,`请输入密码`)},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,s.createVNode)(a,{path:`confirmPassword`,class:`c-login__form-item`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,{value:X.confirmPassword,"onUpdate:value":t[13]||=e=>X.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:v(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:(0,s.withKeys)($,[`enter`])},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[s.vShow,E.value===`register`]]),(0,s.createCommentVNode)(` ===== 注册确认按钮 ===== `),E.value===`register`?((0,s.openBlock)(),(0,s.createBlock)(_,{key:5,type:`primary`,block:``,loading:x.loading||O.value,disabled:x.loading||x.submitDisabled||O.value,class:`c-login__submit-btn`,onClick:$},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`,`disabled`])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 注册视图返回按钮 ===== `),E.value===`register`?((0,s.openBlock)(),(0,s.createBlock)(_,{key:6,block:``,class:`c-login__back-btn`,onClick:t[14]||=e=>E.value=`password`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_back`,`返回`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),E.value===`password`&&(w.value.captchaLogin||w.value.qrcodeLogin)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,m,[w.value.captchaLogin?((0,s.openBlock)(),(0,s.createBlock)(_,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:t[15]||=e=>E.value=`captcha`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0),w.value.qrcodeLogin?((0,s.openBlock)(),(0,s.createBlock)(_,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:t[16]||=e=>E.value=`qrcode`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_qr_login`,`扫码登录`)),1)]),_:1})):(0,s.createCommentVNode)(`v-if`,!0)])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),E.value===`password`&&w.value.socialLogin&&T.value.length?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:8},[(0,s.createVNode)(y,{class:`c-login__divider`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_social_login`,`其他账号登录`)),1)]),_:1}),(0,s.createElementVNode)(`div`,de,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(T.value,e=>((0,s.openBlock)(),(0,s.createBlock)(b,{key:e.key,trigger:`hover`,placement:`top`},{trigger:(0,s.withCtx)(()=>[(0,s.createVNode)(_,{circle:``,class:`c-login__social-btn`,onClick:t=>S(`social-login`,e.key)},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(n.t,{name:e.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)(e.label),1)]),_:2},1024))),128))])],64)):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createCommentVNode)(` ===== 注册入口(仅密码登录默认视图显示) ===== `),E.value===`password`&&w.value.register?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,h,[(0,s.createVNode)(u,{class:`c-login__register-hint`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_no_account`,`还没有账号?`)),1)]),_:1}),(0,s.createVNode)(u,{class:`c-login__register-link`,onClick:t[17]||=e=>E.value=`register`},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(v(`cl_register`,`注册账号`)),1)]),_:1})])):(0,s.createCommentVNode)(`v-if`,!0)],4)}}});var _=t.t(g,[[`__scopeId`,`data-v-88e1442b`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
|
package/dist/C_Login2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./export-helper.js";import{t}from"./C_Icon2.js";import{t as n}from"./C_Captcha2.js";import{t as r}from"./useActionTask.js";import{i,r as a,t as o}from"./storage.js";import{t as ee}from"./C_QRCode2.js";import{Fragment as te,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,defineComponent as m,onMounted as h,onUnmounted as g,openBlock as _,reactive as v,ref as y,renderList as ne,renderSlot as re,resolveComponent as ie,toDisplayString as b,vShow as x,watch as S,withCtx as C,withDirectives as w,withKeys as T}from"vue";import{NButton as ae,NCheckbox as oe,NDivider as se,NForm as ce,NFormItem as le,NInput as ue,NText as de,NTooltip as fe}from"naive-ui";const pe=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],me={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},he={class:`c-login-panel`},ge={class:`c-login__header`},_e={key:0,class:`c-login__logo`},ve={class:`c-login__title`},ye={key:0,class:`c-login__subtitle`},be={key:1,class:`c-login__subtitle c-login__subtitle--register`},xe={key:0,class:`c-login__aux-row`},Se={class:`c-login__code-row`},Ce={key:0,class:`c-login__captcha-wrap`},we={key:3,class:`c-login__qr-panel`},Te={class:`c-login__qr-frame`},Ee={key:1,class:`c-login__qr-placeholder`},De={key:2,class:`c-login__qr-scan-line`},Oe={class:`c-login__qr-hint`},ke={class:`c-login__code-row`},Ae={key:7,class:`c-login__mode-switch`},je={class:`c-login__social-row`},Me={key:9,class:`c-login__register-row`};var E=e(m({__name:`index`,props:{title:{default:`欢迎回来`},subtitle:{},logoIcon:{},features:{},socialProviders:{},qrcodeUrl:{},storageKey:{default:`c_login_remember`},loading:{type:Boolean,default:!1},submitDisabled:{type:Boolean},defaultUsername:{default:``},defaultPassword:{default:``},captchaVerifier:{},captchaProvider:{default:`puzzle-captcha`},captchaChallengeUrl:{},requireCaptchaServerVerification:{type:Boolean,default:!1},captchaVerificationTimeout:{default:1e4}},emits:[`submit`,`captcha-submit`,`send-code`,`social-login`,`forgot-password`,`qrcode-refresh`,`register-submit`,`register-send-code`,`captcha-visible-change`,`username-change`],setup(e,{expose:m,emit:ie}){let E=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},D=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],O=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,Ne=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,k=e,A=ie,j=s(()=>({...k,features:{...me,...k.features},socialProviders:k.socialProviders??pe})),M=s(()=>j.value.features),Pe=s(()=>j.value.socialProviders),N=y(`password`),Fe=r(),P=s(()=>Fe.isRunning(N.value)),Ie=!1,F=0;S(N,()=>F++,{flush:`sync`});let I=e=>!Ie&&N.value===e&&!k.loading&&!k.submitDisabled&&(e!==`password`||!M.value.captchaVerify||G.value);async function L(e,t,n,r){await Fe.run(e,async()=>{let i=t.value;if(!i)return;let a=F,o={...n};try{await i.validate()}catch{return}!I(e)||a!==F||i!==t.value||!Object.keys(o).every(e=>o[e]===n[e])||r(o)},()=>I(e))}let R=y(null),z=v({username:k.defaultUsername??``,password:k.defaultPassword??``}),Le={username:[{required:!0,message:E(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:E(`cl_password_rule`,`请输入密码`),trigger:`blur`}]};S(()=>z.username,e=>A(`username-change`,e),{immediate:!0,flush:`sync`});let B=y(!1);S([B,()=>z.username],([e])=>{e?i(k.storageKey,{username:z.username}):a(k.storageKey)}),h(()=>{let e=o(k.storageKey);typeof e?.username==`string`&&(z.username=e.username,B.value=!0)});let Re=()=>L(`password`,R,z,e=>{A(`submit`,{...e,...G.value?{captchaToken:K.value,captchaTimestamp:q.value,captchaType:J.value,captchaVerifiedBy:Y.value}:{}})}),ze=y(null),V=v({account:``,code:``}),H=y(0),U=null,Be={account:D(`手机号`,O,`手机号格式错误`),code:[{required:!0,message:E(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},W=y(),G=y(!1),K=y(``),q=y(0),J=y(`puzzle-captcha`),Y=y(),Ve=e=>{G.value=!0,K.value=e.token,q.value=e.timestamp,J.value=e.type,Y.value=e.verifiedBy},He=()=>{G.value=!1},Ue=e=>{G.value=e,e||(K.value=``,q.value=0,J.value=`puzzle-captcha`,Y.value=void 0)},We=()=>{G.value=!1,K.value=``,q.value=0,J.value=`puzzle-captcha`,Y.value=void 0,W.value?.reset()},Ge=()=>L(`captcha`,ze,V,e=>A(`captcha-submit`,e)),Ke=()=>{let e=V.account.trim();H.value>0||!O.test(e)||(A(`send-code`,e),U&&=(clearInterval(U),null),H.value=60,U=setInterval(()=>{H.value--,H.value<=0&&(clearInterval(U),U=null)},1e3))},X=s(()=>k.qrcodeUrl?.trim()??``),qe=()=>{A(`qrcode-refresh`)},Je=y(null),Z=v({phone:``,code:``,password:``,confirmPassword:``}),Q=y(0),$=null,Ye={phone:D(`手机号`,O,`手机号格式错误`),code:[{required:!0,message:E(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:D(`密码`,Ne,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:E(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===Z.password?!0:Error(E(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},Xe=()=>{let e=Z.phone.trim();Q.value>0||!O.test(e)||(A(`register-send-code`,e),$&&=(clearInterval($),null),Q.value=60,$=setInterval(()=>{Q.value--,Q.value<=0&&(clearInterval($),$=null)},1e3))},Ze=()=>L(`register`,Je,Z,e=>A(`register-submit`,e));return g(()=>{Ie=!0,U&&=(clearInterval(U),null),$&&=(clearInterval($),null)}),m({resetCaptcha:We}),(e,r)=>{let i=ue,a=le,o=oe,s=de,m=ce,h=ae,g=se,v=fe;return _(),u(`div`,he,[l(` ===== Logo / 标题区 ===== `),d(`div`,ge,[re(e.$slots,`logo`,{},()=>[j.value.logoIcon?(_(),u(`div`,_e,[p(t,{name:j.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):l(`v-if`,!0)],!0),d(`h2`,ve,b(j.value.title),1),j.value.subtitle&&N.value!==`register`?(_(),u(`p`,ye,b(j.value.subtitle),1)):l(`v-if`,!0),l(` 注册视图的副标题 `),N.value===`register`?(_(),u(`p`,be,b(E(`cl_register`,`注册账号`)),1)):l(`v-if`,!0)]),l(` ===== 密码登录表单(默认视图) ===== `),w(p(m,{ref_key:`passwordFormRef`,ref:R,model:z,rules:Le,class:`c-login__form`},{default:C(()=>[p(a,{path:`username`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:z.username,"onUpdate:value":r[0]||=e=>z.username=e,disabled:k.loading,placeholder:E(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:C(()=>[p(t,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),p(a,{path:`password`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:z.password,"onUpdate:value":r[1]||=e=>z.password=e,disabled:k.loading,type:`password`,"show-password-on":`click`,placeholder:E(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:T(Re,[`enter`])},{prefix:C(()=>[p(t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),l(` 宿主扩展字段只获得账号与忙碌状态,不暴露密码。 `),re(e.$slots,`password-fields`,{username:z.username,loading:k.loading||P.value},void 0,!0),l(` 记住我 + 忘记密码 `),M.value.rememberMe||M.value.forgotPassword?(_(),u(`div`,xe,[M.value.rememberMe?(_(),c(o,{key:0,checked:B.value,"onUpdate:checked":r[2]||=e=>B.value=e,class:`c-login__remember`},{default:C(()=>[f(b(E(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):l(`v-if`,!0),M.value.forgotPassword?(_(),c(s,{key:1,class:`c-login__forgot`,onClick:r[3]||=e=>A(`forgot-password`)},{default:C(()=>[f(b(E(`cl_forgot`,`忘记密码?`)),1)]),_:1})):l(`v-if`,!0)])):l(`v-if`,!0)]),_:3},8,[`model`]),[[x,N.value===`password`]]),l(` ===== 验证码登录表单 ===== `),w(p(m,{ref_key:`captchaFormRef`,ref:ze,model:V,rules:Be,class:`c-login__form`},{default:C(()=>[p(a,{path:`account`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:V.account,"onUpdate:value":r[4]||=e=>V.account=e,placeholder:E(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:C(()=>[p(t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(a,{path:`code`,class:`c-login__form-item`},{default:C(()=>[d(`div`,Se,[p(i,{value:V.code,"onUpdate:value":r[5]||=e=>V.code=e,placeholder:E(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:T(Ge,[`enter`])},{prefix:C(()=>[p(t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),p(h,{disabled:H.value>0||!V.account,class:`c-login__send-code-btn`,onClick:Ke},{default:C(()=>[f(b(H.value>0?`${H.value}s ${E(`cl_resend`,`后重发`)}`:E(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[x,N.value===`captcha`]]),l(` ===== 人机验证拼图(仅密码登录模式) ===== `),M.value.captchaVerify&&N.value===`password`?(_(),u(`div`,Ce,[p(n,{ref_key:`captchaRef`,ref:W,theme:`dark`,provider:k.captchaProvider,"challenge-url":k.captchaChallengeUrl,verifier:k.captchaVerifier,"require-server-verification":k.requireCaptchaServerVerification,"verification-timeout":k.captchaVerificationTimeout,onSuccess:Ve,onFail:He,onChange:Ue,onVisibleChange:r[6]||=e=>A(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):l(`v-if`,!0),l(` ===== 登录按钮(密码和验证码模式) ===== `),N.value===`password`||N.value===`captcha`?(_(),c(h,{key:1,type:`primary`,block:``,loading:k.loading||P.value,disabled:k.loading||P.value||k.submitDisabled||N.value===`password`&&M.value.captchaVerify&&!G.value,class:`c-login__submit-btn`,onClick:r[7]||=e=>N.value===`password`?Re():Ge()},{default:C(()=>[f(b(N.value===`password`&&M.value.captchaVerify&&!G.value?E(`cl_verify_first`,`请先完成人机验证`):E(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):l(`v-if`,!0),l(` ===== 返回按钮(验证码子视图) ===== `),N.value===`captcha`?(_(),c(h,{key:2,block:``,class:`c-login__back-btn`,onClick:r[8]||=e=>N.value=`password`},{default:C(()=>[f(b(E(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 扫码登录面板 ===== `),N.value===`qrcode`?(_(),u(`div`,we,[d(`div`,Te,[X.value?(_(),c(ee,{key:0,value:X.value,size:148,margin:1,"show-border":!1,color:`#ffffff`,"bg-color":`#000000`,"error-correction-level":`M`},null,8,[`value`])):(_(),u(`div`,Ee,b(E(`cl_qr_missing`,`请配置二维码地址`)),1)),X.value?(_(),u(`div`,De)):l(`v-if`,!0),r[18]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),r[19]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),r[20]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),r[21]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),d(`p`,Oe,[p(t,{name:`mdi:cellphone-check`,size:13}),f(` `+b(E(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),p(h,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:qe},{icon:C(()=>[p(t,{name:`mdi:refresh`,size:12})]),default:C(()=>[f(` `+b(E(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):l(`v-if`,!0),l(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),N.value===`qrcode`?(_(),c(h,{key:4,block:``,class:`c-login__back-btn`,onClick:r[9]||=e=>N.value=`password`},{default:C(()=>[f(b(E(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 注册表单 ===== `),w(p(m,{ref_key:`registerFormRef`,ref:Je,model:Z,rules:Ye,class:`c-login__form`},{default:C(()=>[p(a,{path:`phone`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:Z.phone,"onUpdate:value":r[10]||=e=>Z.phone=e,placeholder:E(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:C(()=>[p(t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(a,{path:`code`,class:`c-login__form-item`},{default:C(()=>[d(`div`,ke,[p(i,{value:Z.code,"onUpdate:value":r[11]||=e=>Z.code=e,placeholder:E(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:C(()=>[p(t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),p(h,{disabled:Q.value>0||!Z.phone,class:`c-login__send-code-btn`,onClick:Xe},{default:C(()=>[f(b(Q.value>0?`${Q.value}s ${E(`cl_resend`,`后重发`)}`:E(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),p(a,{path:`password`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:Z.password,"onUpdate:value":r[12]||=e=>Z.password=e,type:`password`,"show-password-on":`click`,placeholder:E(`cl_password_ph`,`请输入密码`)},{prefix:C(()=>[p(t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(a,{path:`confirmPassword`,class:`c-login__form-item`},{default:C(()=>[p(i,{value:Z.confirmPassword,"onUpdate:value":r[13]||=e=>Z.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:E(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:T(Ze,[`enter`])},{prefix:C(()=>[p(t,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[x,N.value===`register`]]),l(` ===== 注册确认按钮 ===== `),N.value===`register`?(_(),c(h,{key:5,type:`primary`,block:``,loading:k.loading||P.value,disabled:k.loading||k.submitDisabled||P.value,class:`c-login__submit-btn`,onClick:Ze},{default:C(()=>[f(b(E(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`,`disabled`])):l(`v-if`,!0),l(` ===== 注册视图返回按钮 ===== `),N.value===`register`?(_(),c(h,{key:6,block:``,class:`c-login__back-btn`,onClick:r[14]||=e=>N.value=`password`},{default:C(()=>[f(b(E(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),N.value===`password`&&(M.value.captchaLogin||M.value.qrcodeLogin)?(_(),u(`div`,Ae,[M.value.captchaLogin?(_(),c(h,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:r[15]||=e=>N.value=`captcha`},{default:C(()=>[f(b(E(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):l(`v-if`,!0),M.value.qrcodeLogin?(_(),c(h,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:r[16]||=e=>N.value=`qrcode`},{default:C(()=>[f(b(E(`cl_qr_login`,`扫码登录`)),1)]),_:1})):l(`v-if`,!0)])):l(`v-if`,!0),l(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),N.value===`password`&&M.value.socialLogin&&Pe.value.length?(_(),u(te,{key:8},[p(g,{class:`c-login__divider`},{default:C(()=>[f(b(E(`cl_social_login`,`其他账号登录`)),1)]),_:1}),d(`div`,je,[(_(!0),u(te,null,ne(Pe.value,e=>(_(),c(v,{key:e.key,trigger:`hover`,placement:`top`},{trigger:C(()=>[p(h,{circle:``,class:`c-login__social-btn`,onClick:t=>A(`social-login`,e.key)},{icon:C(()=>[p(t,{name:e.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:C(()=>[f(` `+b(e.label),1)]),_:2},1024))),128))])],64)):l(`v-if`,!0),l(` ===== 注册入口(仅密码登录默认视图显示) ===== `),N.value===`password`&&M.value.register?(_(),u(`div`,Me,[p(s,{class:`c-login__register-hint`},{default:C(()=>[f(b(E(`cl_no_account`,`还没有账号?`)),1)]),_:1}),p(s,{class:`c-login__register-link`,onClick:r[17]||=e=>N.value=`register`},{default:C(()=>[f(b(E(`cl_register`,`注册账号`)),1)]),_:1})])):l(`v-if`,!0)])}}}),[[`__scopeId`,`data-v-f404fc8e`]]);export{me as n,pe as r,E as t};
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./C_Icon2.js";import{t as ee}from"./C_Captcha2.js";import{t as r}from"./useActionTask.js";import{i,r as a,t as o}from"./storage.js";import{t as te}from"./C_QRCode2.js";import{Fragment as ne,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createTextVNode as f,createVNode as p,defineComponent as m,normalizeStyle as re,onMounted as h,onUnmounted as ie,openBlock as g,reactive as _,ref as v,renderList as ae,renderSlot as y,resolveComponent as oe,toDisplayString as b,unref as se,vShow as x,watch as S,withCtx as C,withDirectives as w,withKeys as T}from"vue";import{NButton as ce,NCheckbox as le,NDivider as ue,NForm as de,NFormItem as fe,NInput as pe,NText as me,NTooltip as he}from"naive-ui";const ge=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],_e={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},ve={class:`c-login__header`},ye={key:0,class:`c-login__logo`},be={class:`c-login__title`},xe={key:0,class:`c-login__subtitle`},Se={key:1,class:`c-login__subtitle c-login__subtitle--register`},Ce={key:0,class:`c-login__aux-row`},we={class:`c-login__code-row`},Te={key:0,class:`c-login__captcha-wrap`},Ee={key:3,class:`c-login__qr-panel`},De={class:`c-login__qr-frame`},Oe={key:1,class:`c-login__qr-placeholder`},ke={key:2,class:`c-login__qr-scan-line`},Ae={class:`c-login__qr-hint`},je={class:`c-login__code-row`},Me={key:7,class:`c-login__mode-switch`},Ne={class:`c-login__social-row`},Pe={key:9,class:`c-login__register-row`};var E=t(m({__name:`index`,props:{title:{default:`欢迎回来`},subtitle:{},logoIcon:{},features:{},socialProviders:{},qrcodeUrl:{},storageKey:{default:`c_login_remember`},loading:{type:Boolean,default:!1},submitDisabled:{type:Boolean},defaultUsername:{default:``},defaultPassword:{default:``},captchaVerifier:{},captchaProvider:{default:`puzzle-captcha`},captchaChallengeUrl:{},requireCaptchaServerVerification:{type:Boolean,default:!1},captchaVerificationTimeout:{default:1e4}},emits:[`submit`,`captcha-submit`,`send-code`,`social-login`,`forgot-password`,`qrcode-refresh`,`register-submit`,`register-send-code`,`captcha-visible-change`,`username-change`],setup(t,{expose:m,emit:oe}){let E=e(),D=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},O=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],k=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,Fe=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,A=t,j=oe,M=s(()=>({...A,features:{..._e,...A.features},socialProviders:A.socialProviders??ge})),N=s(()=>M.value.features),Ie=s(()=>M.value.socialProviders),P=v(`password`),Le=r(),F=s(()=>Le.isRunning(P.value)),Re=!1,I=0;S(P,()=>I++,{flush:`sync`});let ze=e=>!Re&&P.value===e&&!A.loading&&!A.submitDisabled&&(e!==`password`||!N.value.captchaVerify||U.value);async function L(e,t,n,ee){await Le.run(e,async()=>{let r=t.value;if(!r)return;let i=I,a={...n};try{await r.validate()}catch{return}!ze(e)||i!==I||r!==t.value||!Object.keys(a).every(e=>a[e]===n[e])||ee(a)},()=>ze(e))}let Be=v(null),R=_({username:A.defaultUsername??``,password:A.defaultPassword??``}),Ve={username:[{required:!0,message:D(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:D(`cl_password_rule`,`请输入密码`),trigger:`blur`}]};S(()=>R.username,e=>j(`username-change`,e),{immediate:!0,flush:`sync`});let z=v(!1);S([z,()=>R.username],([e])=>{e?i(A.storageKey,{username:R.username}):a(A.storageKey)}),h(()=>{let e=o(A.storageKey);typeof e?.username==`string`&&(R.username=e.username,z.value=!0)});let He=()=>L(`password`,Be,R,e=>{j(`submit`,{...e,...U.value?{captchaToken:W.value,captchaTimestamp:G.value,captchaType:K.value,captchaVerifiedBy:q.value}:{}})}),Ue=v(null),B=_({account:``,code:``}),V=v(0),H=null,We={account:O(`手机号`,k,`手机号格式错误`),code:[{required:!0,message:D(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},Ge=v(),U=v(!1),W=v(``),G=v(0),K=v(`puzzle-captcha`),q=v(),Ke=e=>{U.value=!0,W.value=e.token,G.value=e.timestamp,K.value=e.type,q.value=e.verifiedBy},qe=()=>{U.value=!1},Je=e=>{U.value=e,e||(W.value=``,G.value=0,K.value=`puzzle-captcha`,q.value=void 0)},Ye=()=>{U.value=!1,W.value=``,G.value=0,K.value=`puzzle-captcha`,q.value=void 0,Ge.value?.reset()},J=()=>L(`captcha`,Ue,B,e=>j(`captcha-submit`,e)),Xe=()=>{let e=B.account.trim();V.value>0||!k.test(e)||(j(`send-code`,e),H&&=(clearInterval(H),null),V.value=60,H=setInterval(()=>{V.value--,V.value<=0&&(clearInterval(H),H=null)},1e3))},Y=s(()=>A.qrcodeUrl?.trim()??``),Ze=()=>{j(`qrcode-refresh`)},Qe=v(null),X=_({phone:``,code:``,password:``,confirmPassword:``}),Z=v(0),Q=null,$e={phone:O(`手机号`,k,`手机号格式错误`),code:[{required:!0,message:D(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:O(`密码`,Fe,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:D(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===X.password?!0:Error(D(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},et=()=>{let e=X.phone.trim();Z.value>0||!k.test(e)||(j(`register-send-code`,e),Q&&=(clearInterval(Q),null),Z.value=60,Q=setInterval(()=>{Z.value--,Z.value<=0&&(clearInterval(Q),Q=null)},1e3))},$=()=>L(`register`,Qe,X,e=>j(`register-submit`,e));return ie(()=>{Re=!0,H&&=(clearInterval(H),null),Q&&=(clearInterval(Q),null)}),m({resetCaptcha:Ye}),(e,t)=>{let r=pe,i=fe,a=le,o=me,s=de,m=ce,h=ue,ie=he;return g(),u(`div`,{class:`c-login-panel`,style:re(se(E))},[l(` ===== Logo / 标题区 ===== `),d(`div`,ve,[y(e.$slots,`logo`,{},()=>[M.value.logoIcon?(g(),u(`div`,ye,[p(n,{name:M.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):l(`v-if`,!0)],!0),d(`h2`,be,b(M.value.title),1),M.value.subtitle&&P.value!==`register`?(g(),u(`p`,xe,b(M.value.subtitle),1)):l(`v-if`,!0),l(` 注册视图的副标题 `),P.value===`register`?(g(),u(`p`,Se,b(D(`cl_register`,`注册账号`)),1)):l(`v-if`,!0)]),l(` ===== 密码登录表单(默认视图) ===== `),w(p(s,{ref_key:`passwordFormRef`,ref:Be,model:R,rules:Ve,class:`c-login__form`},{default:C(()=>[p(i,{path:`username`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:R.username,"onUpdate:value":t[0]||=e=>R.username=e,disabled:A.loading,placeholder:D(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:C(()=>[p(n,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),p(i,{path:`password`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:R.password,"onUpdate:value":t[1]||=e=>R.password=e,disabled:A.loading,type:`password`,"show-password-on":`click`,placeholder:D(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:T(He,[`enter`])},{prefix:C(()=>[p(n,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),l(` 宿主扩展字段只获得账号与忙碌状态,不暴露密码。 `),y(e.$slots,`password-fields`,{username:R.username,loading:A.loading||F.value},void 0,!0),l(` 记住我 + 忘记密码 `),N.value.rememberMe||N.value.forgotPassword?(g(),u(`div`,Ce,[N.value.rememberMe?(g(),c(a,{key:0,checked:z.value,"onUpdate:checked":t[2]||=e=>z.value=e,class:`c-login__remember`},{default:C(()=>[f(b(D(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):l(`v-if`,!0),N.value.forgotPassword?(g(),c(o,{key:1,class:`c-login__forgot`,onClick:t[3]||=e=>j(`forgot-password`)},{default:C(()=>[f(b(D(`cl_forgot`,`忘记密码?`)),1)]),_:1})):l(`v-if`,!0)])):l(`v-if`,!0)]),_:3},8,[`model`]),[[x,P.value===`password`]]),l(` ===== 验证码登录表单 ===== `),w(p(s,{ref_key:`captchaFormRef`,ref:Ue,model:B,rules:We,class:`c-login__form`},{default:C(()=>[p(i,{path:`account`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:B.account,"onUpdate:value":t[4]||=e=>B.account=e,placeholder:D(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:C(()=>[p(n,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(i,{path:`code`,class:`c-login__form-item`},{default:C(()=>[d(`div`,we,[p(r,{value:B.code,"onUpdate:value":t[5]||=e=>B.code=e,placeholder:D(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:T(J,[`enter`])},{prefix:C(()=>[p(n,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),p(m,{disabled:V.value>0||!B.account,class:`c-login__send-code-btn`,onClick:Xe},{default:C(()=>[f(b(V.value>0?`${V.value}s ${D(`cl_resend`,`后重发`)}`:D(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[x,P.value===`captcha`]]),l(` ===== 人机验证拼图(仅密码登录模式) ===== `),N.value.captchaVerify&&P.value===`password`?(g(),u(`div`,Te,[p(ee,{ref_key:`captchaRef`,ref:Ge,theme:`dark`,provider:A.captchaProvider,"challenge-url":A.captchaChallengeUrl,verifier:A.captchaVerifier,"require-server-verification":A.requireCaptchaServerVerification,"verification-timeout":A.captchaVerificationTimeout,onSuccess:Ke,onFail:qe,onChange:Je,onVisibleChange:t[6]||=e=>j(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):l(`v-if`,!0),l(` ===== 登录按钮(密码和验证码模式) ===== `),P.value===`password`||P.value===`captcha`?(g(),c(m,{key:1,type:`primary`,block:``,loading:A.loading||F.value,disabled:A.loading||F.value||A.submitDisabled||P.value===`password`&&N.value.captchaVerify&&!U.value,class:`c-login__submit-btn`,onClick:t[7]||=e=>P.value===`password`?He():J()},{default:C(()=>[f(b(P.value===`password`&&N.value.captchaVerify&&!U.value?D(`cl_verify_first`,`请先完成人机验证`):D(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):l(`v-if`,!0),l(` ===== 返回按钮(验证码子视图) ===== `),P.value===`captcha`?(g(),c(m,{key:2,block:``,class:`c-login__back-btn`,onClick:t[8]||=e=>P.value=`password`},{default:C(()=>[f(b(D(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 扫码登录面板 ===== `),P.value===`qrcode`?(g(),u(`div`,Ee,[d(`div`,De,[Y.value?(g(),c(te,{key:0,value:Y.value,size:148,margin:1,"show-border":!1,color:`#ffffff`,"bg-color":`#000000`,"error-correction-level":`M`},null,8,[`value`])):(g(),u(`div`,Oe,b(D(`cl_qr_missing`,`请配置二维码地址`)),1)),Y.value?(g(),u(`div`,ke)):l(`v-if`,!0),t[18]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),t[19]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),t[20]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),t[21]||=d(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),d(`p`,Ae,[p(n,{name:`mdi:cellphone-check`,size:13}),f(` `+b(D(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),p(m,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:Ze},{icon:C(()=>[p(n,{name:`mdi:refresh`,size:12})]),default:C(()=>[f(` `+b(D(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):l(`v-if`,!0),l(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),P.value===`qrcode`?(g(),c(m,{key:4,block:``,class:`c-login__back-btn`,onClick:t[9]||=e=>P.value=`password`},{default:C(()=>[f(b(D(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 注册表单 ===== `),w(p(s,{ref_key:`registerFormRef`,ref:Qe,model:X,rules:$e,class:`c-login__form`},{default:C(()=>[p(i,{path:`phone`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:X.phone,"onUpdate:value":t[10]||=e=>X.phone=e,placeholder:D(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:C(()=>[p(n,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(i,{path:`code`,class:`c-login__form-item`},{default:C(()=>[d(`div`,je,[p(r,{value:X.code,"onUpdate:value":t[11]||=e=>X.code=e,placeholder:D(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:C(()=>[p(n,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),p(m,{disabled:Z.value>0||!X.phone,class:`c-login__send-code-btn`,onClick:et},{default:C(()=>[f(b(Z.value>0?`${Z.value}s ${D(`cl_resend`,`后重发`)}`:D(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),p(i,{path:`password`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:X.password,"onUpdate:value":t[12]||=e=>X.password=e,type:`password`,"show-password-on":`click`,placeholder:D(`cl_password_ph`,`请输入密码`)},{prefix:C(()=>[p(n,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),p(i,{path:`confirmPassword`,class:`c-login__form-item`},{default:C(()=>[p(r,{value:X.confirmPassword,"onUpdate:value":t[13]||=e=>X.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:D(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:T($,[`enter`])},{prefix:C(()=>[p(n,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[x,P.value===`register`]]),l(` ===== 注册确认按钮 ===== `),P.value===`register`?(g(),c(m,{key:5,type:`primary`,block:``,loading:A.loading||F.value,disabled:A.loading||A.submitDisabled||F.value,class:`c-login__submit-btn`,onClick:$},{default:C(()=>[f(b(D(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`,`disabled`])):l(`v-if`,!0),l(` ===== 注册视图返回按钮 ===== `),P.value===`register`?(g(),c(m,{key:6,block:``,class:`c-login__back-btn`,onClick:t[14]||=e=>P.value=`password`},{default:C(()=>[f(b(D(`cl_back`,`返回`)),1)]),_:1})):l(`v-if`,!0),l(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),P.value===`password`&&(N.value.captchaLogin||N.value.qrcodeLogin)?(g(),u(`div`,Me,[N.value.captchaLogin?(g(),c(m,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:t[15]||=e=>P.value=`captcha`},{default:C(()=>[f(b(D(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):l(`v-if`,!0),N.value.qrcodeLogin?(g(),c(m,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:t[16]||=e=>P.value=`qrcode`},{default:C(()=>[f(b(D(`cl_qr_login`,`扫码登录`)),1)]),_:1})):l(`v-if`,!0)])):l(`v-if`,!0),l(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),P.value===`password`&&N.value.socialLogin&&Ie.value.length?(g(),u(ne,{key:8},[p(h,{class:`c-login__divider`},{default:C(()=>[f(b(D(`cl_social_login`,`其他账号登录`)),1)]),_:1}),d(`div`,Ne,[(g(!0),u(ne,null,ae(Ie.value,e=>(g(),c(ie,{key:e.key,trigger:`hover`,placement:`top`},{trigger:C(()=>[p(m,{circle:``,class:`c-login__social-btn`,onClick:t=>j(`social-login`,e.key)},{icon:C(()=>[p(n,{name:e.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:C(()=>[f(` `+b(e.label),1)]),_:2},1024))),128))])],64)):l(`v-if`,!0),l(` ===== 注册入口(仅密码登录默认视图显示) ===== `),P.value===`password`&&N.value.register?(g(),u(`div`,Pe,[p(o,{class:`c-login__register-hint`},{default:C(()=>[f(b(D(`cl_no_account`,`还没有账号?`)),1)]),_:1}),p(o,{class:`c-login__register-link`,onClick:t[17]||=e=>P.value=`register`},{default:C(()=>[f(b(D(`cl_register`,`注册账号`)),1)]),_:1})])):l(`v-if`,!0)],4)}}}),[[`__scopeId`,`data-v-88e1442b`]]);export{_e as n,ge as r,E as t};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@import "./shared-tokens.css";
|
|
2
|
-
.notification-badge[data-v-
|
|
2
|
+
.notification-badge[data-v-bf1faaa2] {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
}
|
|
7
|
-
.notification-badge__trigger[data-v-
|
|
7
|
+
.notification-badge__trigger[data-v-bf1faaa2] {
|
|
8
8
|
appearance: none;
|
|
9
9
|
border: 0;
|
|
10
10
|
background: transparent;
|
|
@@ -19,21 +19,21 @@
|
|
|
19
19
|
border-radius: 6px;
|
|
20
20
|
transition: all var(--c-transition, 0.2s ease);
|
|
21
21
|
}
|
|
22
|
-
.notification-badge__trigger[data-v-
|
|
22
|
+
.notification-badge__trigger[data-v-bf1faaa2]:hover {
|
|
23
23
|
background-color: var(--c-border, var(--c-theme-border));
|
|
24
24
|
}
|
|
25
|
-
.notification-badge__trigger:hover .notification-badge__icon[data-v-
|
|
25
|
+
.notification-badge__trigger:hover .notification-badge__icon[data-v-bf1faaa2] {
|
|
26
26
|
color: var(--c-primary, var(--c-theme-primary));
|
|
27
27
|
}
|
|
28
|
-
.notification-badge__trigger[data-v-
|
|
28
|
+
.notification-badge__trigger[data-v-bf1faaa2]:focus-visible {
|
|
29
29
|
outline: 2px solid var(--c-primary, var(--c-theme-primary));
|
|
30
30
|
outline-offset: 2px;
|
|
31
31
|
}
|
|
32
|
-
.notification-badge__icon[data-v-
|
|
32
|
+
.notification-badge__icon[data-v-bf1faaa2] {
|
|
33
33
|
color: var(--c-text-2, var(--c-theme-text-2));
|
|
34
34
|
transition: color var(--c-transition, 0.2s ease);
|
|
35
35
|
}
|
|
36
|
-
.notification-badge__count[data-v-
|
|
36
|
+
.notification-badge__count[data-v-bf1faaa2] {
|
|
37
37
|
position: absolute;
|
|
38
38
|
top: -2px;
|
|
39
39
|
right: -4px;
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
text-align: center;
|
|
50
50
|
white-space: nowrap;
|
|
51
51
|
pointer-events: none;
|
|
52
|
-
box-shadow: 0 0 0 2px var(--c-bg);
|
|
52
|
+
box-shadow: 0 0 0 2px var(--c-bg-surface, var(--c-theme-bg-surface, #fff));
|
|
53
53
|
}
|
|
54
|
-
.notification-badge__pulse[data-v-
|
|
54
|
+
.notification-badge__pulse[data-v-bf1faaa2] {
|
|
55
55
|
position: absolute;
|
|
56
56
|
top: -2px;
|
|
57
57
|
right: -4px;
|
|
58
58
|
width: 16px;
|
|
59
59
|
height: 16px;
|
|
60
60
|
border-radius: 50%;
|
|
61
|
-
background:
|
|
62
|
-
animation: pulse-ring-
|
|
61
|
+
background: color-mix(in srgb, var(--c-error, var(--c-theme-error)) 40%, transparent);
|
|
62
|
+
animation: pulse-ring-bf1faaa2 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
|
|
63
63
|
pointer-events: none;
|
|
64
64
|
}
|
|
65
|
-
@keyframes pulse-ring-
|
|
65
|
+
@keyframes pulse-ring-bf1faaa2 {
|
|
66
66
|
0% {
|
|
67
67
|
transform: scale(0.8);
|
|
68
68
|
opacity: 1;
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
opacity: 0;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
.badge-bounce-enter-active[data-v-
|
|
76
|
-
animation: badge-in-
|
|
75
|
+
.badge-bounce-enter-active[data-v-bf1faaa2] {
|
|
76
|
+
animation: badge-in-bf1faaa2 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
77
77
|
}
|
|
78
|
-
.badge-bounce-leave-active[data-v-
|
|
79
|
-
animation: badge-in-
|
|
78
|
+
.badge-bounce-leave-active[data-v-bf1faaa2] {
|
|
79
|
+
animation: badge-in-bf1faaa2 0.2s ease reverse;
|
|
80
80
|
}
|
|
81
|
-
@keyframes badge-in-
|
|
81
|
+
@keyframes badge-in-bf1faaa2 {
|
|
82
82
|
0% {
|
|
83
83
|
transform: scale(0);
|
|
84
84
|
opacity: 0;
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/* layer: default */
|
|
93
|
-
.absolute[data-v-
|
|
94
|
-
.relative[data-v-
|
|
95
|
-
.inline-flex[data-v-
|
|
96
|
-
.transform[data-v-
|
|
97
|
-
.border[data-v-
|
|
98
|
-
.outline[data-v-
|
|
99
|
-
.transition[data-v-
|
|
100
|
-
.ease[data-v-
|
|
93
|
+
.absolute[data-v-bf1faaa2]{position:absolute;}
|
|
94
|
+
.relative[data-v-bf1faaa2]{position:relative;}
|
|
95
|
+
.inline-flex[data-v-bf1faaa2]{display:inline-flex;}
|
|
96
|
+
.transform[data-v-bf1faaa2]{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}
|
|
97
|
+
.border[data-v-bf1faaa2]{border-width:1px;}
|
|
98
|
+
.outline[data-v-bf1faaa2]{outline-style:solid;}
|
|
99
|
+
.transition[data-v-bf1faaa2]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
100
|
+
.ease[data-v-bf1faaa2]{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}
|
|
101
101
|
|
|
102
102
|
.notification-detail[data-v-32e61327] {
|
|
103
103
|
display: flex;
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
.flex-wrap[data-v-32e61327]{flex-wrap:wrap;}
|
|
176
176
|
.px[data-v-32e61327]{padding-left:1rem;padding-right:1rem;}
|
|
177
177
|
|
|
178
|
-
.notification-item[data-v-
|
|
178
|
+
.notification-item[data-v-ec01c393] {
|
|
179
179
|
display: flex;
|
|
180
180
|
align-items: flex-start;
|
|
181
181
|
gap: 10px;
|
|
@@ -184,58 +184,58 @@
|
|
|
184
184
|
transition: background-color var(--c-transition, 0.2s ease);
|
|
185
185
|
border-bottom: 1px solid var(--c-border, var(--c-theme-border));
|
|
186
186
|
}
|
|
187
|
-
.notification-item[data-v-
|
|
187
|
+
.notification-item[data-v-ec01c393]:last-child {
|
|
188
188
|
border-bottom: none;
|
|
189
189
|
}
|
|
190
|
-
.notification-item[data-v-
|
|
190
|
+
.notification-item[data-v-ec01c393]:hover {
|
|
191
191
|
background-color: var(--c-bg-card, var(--c-theme-bg-card));
|
|
192
192
|
}
|
|
193
|
-
.notification-item:hover .notification-item__actions[data-v-
|
|
193
|
+
.notification-item:hover .notification-item__actions[data-v-ec01c393] {
|
|
194
194
|
opacity: 1;
|
|
195
195
|
}
|
|
196
|
-
.notification-item--unread[data-v-
|
|
196
|
+
.notification-item--unread[data-v-ec01c393] {
|
|
197
197
|
background-color: color-mix(in srgb, var(--c-primary, var(--c-theme-primary)) 4%, transparent);
|
|
198
198
|
}
|
|
199
|
-
.notification-item--unread[data-v-
|
|
199
|
+
.notification-item--unread[data-v-ec01c393]:hover {
|
|
200
200
|
background-color: color-mix(in srgb, var(--c-primary, var(--c-theme-primary)) 8%, transparent);
|
|
201
201
|
}
|
|
202
|
-
.notification-item--urgent[data-v-
|
|
202
|
+
.notification-item--urgent[data-v-ec01c393] {
|
|
203
203
|
border-left: 3px solid var(--c-error, var(--c-theme-error, #d03050));
|
|
204
204
|
padding-left: 13px;
|
|
205
205
|
}
|
|
206
|
-
.notification-item[data-v-
|
|
206
|
+
.notification-item[data-v-ec01c393] {
|
|
207
207
|
/* ─── 子元素 ──────────────────────────── */
|
|
208
208
|
}
|
|
209
|
-
.notification-item__indicator[data-v-
|
|
209
|
+
.notification-item__indicator[data-v-ec01c393] {
|
|
210
210
|
flex-shrink: 0;
|
|
211
211
|
width: 8px;
|
|
212
212
|
display: flex;
|
|
213
213
|
align-items: center;
|
|
214
214
|
padding-top: 14px;
|
|
215
215
|
}
|
|
216
|
-
.notification-item__dot[data-v-
|
|
216
|
+
.notification-item__dot[data-v-ec01c393] {
|
|
217
217
|
width: 6px;
|
|
218
218
|
height: 6px;
|
|
219
219
|
border-radius: 50%;
|
|
220
220
|
background: var(--c-primary, var(--c-theme-primary));
|
|
221
221
|
}
|
|
222
|
-
.notification-item__dot--urgent[data-v-
|
|
222
|
+
.notification-item__dot--urgent[data-v-ec01c393] {
|
|
223
223
|
background: var(--c-error, var(--c-theme-error, #d03050));
|
|
224
|
-
box-shadow: 0 0 4px
|
|
224
|
+
box-shadow: 0 0 4px color-mix(in srgb, var(--c-error, var(--c-theme-error)) 50%, transparent);
|
|
225
225
|
}
|
|
226
|
-
.notification-item__dot--high[data-v-
|
|
227
|
-
background: #fa8c16;
|
|
226
|
+
.notification-item__dot--high[data-v-ec01c393] {
|
|
227
|
+
background: var(--c-warning, var(--c-theme-warning, #fa8c16));
|
|
228
228
|
}
|
|
229
|
-
.notification-item__dot--normal[data-v-
|
|
229
|
+
.notification-item__dot--normal[data-v-ec01c393] {
|
|
230
230
|
background: var(--c-primary, var(--c-theme-primary));
|
|
231
231
|
}
|
|
232
|
-
.notification-item__dot--low[data-v-
|
|
232
|
+
.notification-item__dot--low[data-v-ec01c393] {
|
|
233
233
|
background: var(--c-text-4, var(--c-theme-text-4));
|
|
234
234
|
}
|
|
235
|
-
.notification-item__avatar[data-v-
|
|
235
|
+
.notification-item__avatar[data-v-ec01c393] {
|
|
236
236
|
flex-shrink: 0;
|
|
237
237
|
}
|
|
238
|
-
.notification-item__avatar-placeholder[data-v-
|
|
238
|
+
.notification-item__avatar-placeholder[data-v-ec01c393] {
|
|
239
239
|
width: 36px;
|
|
240
240
|
height: 36px;
|
|
241
241
|
border-radius: 50%;
|
|
@@ -245,27 +245,27 @@
|
|
|
245
245
|
font-size: 16px;
|
|
246
246
|
color: #fff;
|
|
247
247
|
}
|
|
248
|
-
.notification-item__avatar-placeholder--system[data-v-
|
|
248
|
+
.notification-item__avatar-placeholder--system[data-v-ec01c393] {
|
|
249
249
|
background: linear-gradient(135deg, #667eea, #764ba2);
|
|
250
250
|
}
|
|
251
|
-
.notification-item__avatar-placeholder--business[data-v-
|
|
251
|
+
.notification-item__avatar-placeholder--business[data-v-ec01c393] {
|
|
252
252
|
background: linear-gradient(135deg, #43e97b, #38f9d7);
|
|
253
253
|
color: #0d1425;
|
|
254
254
|
}
|
|
255
|
-
.notification-item__avatar-placeholder--alarm[data-v-
|
|
255
|
+
.notification-item__avatar-placeholder--alarm[data-v-ec01c393] {
|
|
256
256
|
background: linear-gradient(135deg, #f093fb, #f5576c);
|
|
257
257
|
}
|
|
258
|
-
.notification-item__body[data-v-
|
|
258
|
+
.notification-item__body[data-v-ec01c393] {
|
|
259
259
|
flex: 1;
|
|
260
260
|
min-width: 0;
|
|
261
261
|
}
|
|
262
|
-
.notification-item__header[data-v-
|
|
262
|
+
.notification-item__header[data-v-ec01c393] {
|
|
263
263
|
display: flex;
|
|
264
264
|
align-items: center;
|
|
265
265
|
gap: 6px;
|
|
266
266
|
margin-bottom: 4px;
|
|
267
267
|
}
|
|
268
|
-
.notification-item__title[data-v-
|
|
268
|
+
.notification-item__title[data-v-ec01c393] {
|
|
269
269
|
font-size: 13px;
|
|
270
270
|
font-weight: 500;
|
|
271
271
|
color: var(--c-text-1, var(--c-theme-text-1));
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
text-overflow: ellipsis;
|
|
275
275
|
white-space: nowrap;
|
|
276
276
|
}
|
|
277
|
-
.notification-item__summary[data-v-
|
|
277
|
+
.notification-item__summary[data-v-ec01c393] {
|
|
278
278
|
font-size: 12px;
|
|
279
279
|
color: var(--c-text-2, var(--c-theme-text-2));
|
|
280
280
|
line-height: 1.5;
|
|
@@ -284,21 +284,21 @@
|
|
|
284
284
|
-webkit-box-orient: vertical;
|
|
285
285
|
overflow: hidden;
|
|
286
286
|
}
|
|
287
|
-
.notification-item__meta[data-v-
|
|
287
|
+
.notification-item__meta[data-v-ec01c393] {
|
|
288
288
|
display: flex;
|
|
289
289
|
align-items: center;
|
|
290
290
|
gap: 8px;
|
|
291
291
|
margin-top: 6px;
|
|
292
292
|
}
|
|
293
|
-
.notification-item__time[data-v-
|
|
293
|
+
.notification-item__time[data-v-ec01c393], .notification-item__sender[data-v-ec01c393] {
|
|
294
294
|
font-size: 11px;
|
|
295
295
|
color: var(--c-text-4, var(--c-theme-text-4));
|
|
296
296
|
}
|
|
297
|
-
.notification-item__sender[data-v-
|
|
297
|
+
.notification-item__sender[data-v-ec01c393]::before {
|
|
298
298
|
content: "·";
|
|
299
299
|
margin-right: 8px;
|
|
300
300
|
}
|
|
301
|
-
.notification-item__actions[data-v-
|
|
301
|
+
.notification-item__actions[data-v-ec01c393] {
|
|
302
302
|
flex-shrink: 0;
|
|
303
303
|
display: flex;
|
|
304
304
|
align-items: center;
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
opacity: 0;
|
|
307
307
|
transition: opacity var(--c-transition, 0.2s ease);
|
|
308
308
|
}
|
|
309
|
-
.notification-item__action[data-v-
|
|
309
|
+
.notification-item__action[data-v-ec01c393] {
|
|
310
310
|
appearance: none;
|
|
311
311
|
border: 0;
|
|
312
312
|
background: transparent;
|
|
@@ -321,22 +321,22 @@
|
|
|
321
321
|
color: var(--c-text-4, var(--c-theme-text-4));
|
|
322
322
|
transition: all var(--c-transition, 0.2s ease);
|
|
323
323
|
}
|
|
324
|
-
.notification-item__action[data-v-
|
|
324
|
+
.notification-item__action[data-v-ec01c393]:hover {
|
|
325
325
|
color: var(--c-primary, var(--c-theme-primary));
|
|
326
326
|
background-color: var(--c-border, var(--c-theme-border));
|
|
327
327
|
}
|
|
328
|
-
.notification-item__action[data-v-
|
|
328
|
+
.notification-item__action[data-v-ec01c393]:disabled {
|
|
329
329
|
cursor: wait;
|
|
330
330
|
opacity: 0.45;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
/* layer: default */
|
|
334
|
-
.hidden[data-v-
|
|
335
|
-
.flex[data-v-
|
|
336
|
-
.inline-flex[data-v-
|
|
337
|
-
.flex-shrink[data-v-
|
|
338
|
-
.border[data-v-
|
|
339
|
-
.transition[data-v-
|
|
334
|
+
.hidden[data-v-ec01c393]{display:none;}
|
|
335
|
+
.flex[data-v-ec01c393]{display:flex;}
|
|
336
|
+
.inline-flex[data-v-ec01c393]{display:inline-flex;}
|
|
337
|
+
.flex-shrink[data-v-ec01c393]{flex-shrink:1;}
|
|
338
|
+
.border[data-v-ec01c393]{border-width:1px;}
|
|
339
|
+
.transition[data-v-ec01c393]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
340
340
|
|
|
341
341
|
.notification-list__tabs[data-v-940afa31] {
|
|
342
342
|
display: flex;
|
|
@@ -460,33 +460,33 @@
|
|
|
460
460
|
.tab[data-v-940afa31]{-moz-tab-size:4;-o-tab-size:4;tab-size:4;}
|
|
461
461
|
.transition[data-v-940afa31]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
462
462
|
|
|
463
|
-
.c-notification-center[data-v-
|
|
463
|
+
.c-notification-center[data-v-76c23d7a] {
|
|
464
464
|
display: inline-flex;
|
|
465
465
|
align-items: center;
|
|
466
466
|
}
|
|
467
|
-
.c-notification-center__panel[data-v-
|
|
467
|
+
.c-notification-center__panel[data-v-76c23d7a] {
|
|
468
468
|
display: flex;
|
|
469
469
|
flex-direction: column;
|
|
470
470
|
max-height: 560px;
|
|
471
471
|
}
|
|
472
|
-
.c-notification-center__header[data-v-
|
|
472
|
+
.c-notification-center__header[data-v-76c23d7a] {
|
|
473
473
|
display: flex;
|
|
474
474
|
align-items: center;
|
|
475
475
|
justify-content: space-between;
|
|
476
476
|
padding: 14px 16px 10px;
|
|
477
477
|
border-bottom: 1px solid var(--c-border, var(--c-theme-border));
|
|
478
478
|
}
|
|
479
|
-
.c-notification-center__title[data-v-
|
|
479
|
+
.c-notification-center__title[data-v-76c23d7a] {
|
|
480
480
|
font-size: 15px;
|
|
481
481
|
font-weight: 600;
|
|
482
482
|
color: var(--c-text-1, var(--c-theme-text-1));
|
|
483
483
|
}
|
|
484
|
-
.c-notification-center__header-extra[data-v-
|
|
484
|
+
.c-notification-center__header-extra[data-v-76c23d7a] {
|
|
485
485
|
display: flex;
|
|
486
486
|
align-items: center;
|
|
487
487
|
gap: 8px;
|
|
488
488
|
}
|
|
489
|
-
.c-notification-center__error[data-v-
|
|
489
|
+
.c-notification-center__error[data-v-76c23d7a] {
|
|
490
490
|
display: flex;
|
|
491
491
|
align-items: center;
|
|
492
492
|
justify-content: space-between;
|
|
@@ -494,34 +494,34 @@
|
|
|
494
494
|
margin: 10px 16px;
|
|
495
495
|
padding: 10px;
|
|
496
496
|
color: var(--c-text-1, var(--c-theme-text-1));
|
|
497
|
-
background: color-mix(in srgb,
|
|
497
|
+
background: color-mix(in srgb, var(--c-error, var(--c-theme-error)) 8%, transparent);
|
|
498
498
|
border-radius: 6px;
|
|
499
499
|
font-size: 12px;
|
|
500
500
|
}
|
|
501
|
-
.c-notification-center__footer[data-v-
|
|
501
|
+
.c-notification-center__footer[data-v-76c23d7a] {
|
|
502
502
|
display: flex;
|
|
503
503
|
justify-content: center;
|
|
504
504
|
padding: 10px 16px;
|
|
505
505
|
border-top: 1px solid var(--c-border, var(--c-theme-border));
|
|
506
506
|
}
|
|
507
|
-
.c-notification-center__ws-dot[data-v-
|
|
507
|
+
.c-notification-center__ws-dot[data-v-76c23d7a] {
|
|
508
508
|
width: 8px;
|
|
509
509
|
height: 8px;
|
|
510
510
|
border-radius: 50%;
|
|
511
511
|
transition: background-color var(--c-transition, 0.2s ease);
|
|
512
512
|
}
|
|
513
|
-
.c-notification-center__ws-dot--connected[data-v-
|
|
514
|
-
background: #52c41a;
|
|
515
|
-
box-shadow: 0 0 4px
|
|
513
|
+
.c-notification-center__ws-dot--connected[data-v-76c23d7a] {
|
|
514
|
+
background: var(--c-success, var(--c-theme-success, #52c41a));
|
|
515
|
+
box-shadow: 0 0 4px color-mix(in srgb, var(--c-success, var(--c-theme-success)) 50%, transparent);
|
|
516
516
|
}
|
|
517
|
-
.c-notification-center__ws-dot--connecting[data-v-
|
|
518
|
-
background: #faad14;
|
|
519
|
-
animation: status-blink-
|
|
517
|
+
.c-notification-center__ws-dot--connecting[data-v-76c23d7a], .c-notification-center__ws-dot--reconnecting[data-v-76c23d7a] {
|
|
518
|
+
background: var(--c-warning, var(--c-theme-warning, #faad14));
|
|
519
|
+
animation: status-blink-76c23d7a 1s ease-in-out infinite;
|
|
520
520
|
}
|
|
521
|
-
.c-notification-center__ws-dot--disconnected[data-v-
|
|
521
|
+
.c-notification-center__ws-dot--disconnected[data-v-76c23d7a] {
|
|
522
522
|
background: var(--c-text-4, var(--c-theme-text-4));
|
|
523
523
|
}
|
|
524
|
-
@keyframes status-blink-
|
|
524
|
+
@keyframes status-blink-76c23d7a {
|
|
525
525
|
0%, 100% {
|
|
526
526
|
opacity: 1;
|
|
527
527
|
}
|
|
@@ -530,17 +530,17 @@
|
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
/* ─── 切换过渡 ───────────────────────────────── */
|
|
533
|
-
.slide-fade-enter-active[data-v-
|
|
533
|
+
.slide-fade-enter-active[data-v-76c23d7a] {
|
|
534
534
|
transition: all 0.25s ease-out;
|
|
535
535
|
}
|
|
536
|
-
.slide-fade-leave-active[data-v-
|
|
536
|
+
.slide-fade-leave-active[data-v-76c23d7a] {
|
|
537
537
|
transition: all 0.2s ease-in;
|
|
538
538
|
}
|
|
539
|
-
.slide-fade-enter-from[data-v-
|
|
539
|
+
.slide-fade-enter-from[data-v-76c23d7a] {
|
|
540
540
|
opacity: 0;
|
|
541
541
|
transform: translateY(8px);
|
|
542
542
|
}
|
|
543
|
-
.slide-fade-leave-to[data-v-
|
|
543
|
+
.slide-fade-leave-to[data-v-76c23d7a] {
|
|
544
544
|
opacity: 0;
|
|
545
545
|
transform: translateY(-8px);
|
|
546
546
|
}
|
|
@@ -559,10 +559,10 @@
|
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
/* layer: default */
|
|
562
|
-
.flex[data-v-
|
|
563
|
-
.inline-flex[data-v-
|
|
564
|
-
.transform[data-v-
|
|
565
|
-
.transition[data-v-
|
|
566
|
-
.ease-in[data-v-
|
|
567
|
-
.ease-in-out[data-v-
|
|
568
|
-
.ease-out[data-v-
|
|
562
|
+
.flex[data-v-76c23d7a]{display:flex;}
|
|
563
|
+
.inline-flex[data-v-76c23d7a]{display:inline-flex;}
|
|
564
|
+
.transform[data-v-76c23d7a]{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}
|
|
565
|
+
.transition[data-v-76c23d7a]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
566
|
+
.ease-in[data-v-76c23d7a]{transition-timing-function:cubic-bezier(0.4, 0, 1, 1);}
|
|
567
|
+
.ease-in-out[data-v-76c23d7a]{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}
|
|
568
|
+
.ease-out[data-v-76c23d7a]{transition-timing-function:cubic-bezier(0, 0, 0.2, 1);}
|