@robot-admin/naive-ui-components 0.13.1 → 0.13.2
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 +6 -0
- package/README.md +4 -0
- package/README_EN.md +4 -0
- package/dist/C_Login.css +76 -76
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants2.d.cts +3 -3
- package/dist/constants2.d.ts +3 -3
- package/dist/constants3.d.cts +3 -3
- package/dist/constants3.d.ts +3 -3
- package/dist/constants4.d.cts +7 -7
- package/dist/constants4.d.ts +7 -7
- package/dist/constants5.d.cts +4 -4
- package/dist/constants5.d.ts +4 -4
- package/dist/data.d.cts +5 -5
- package/dist/data.d.ts +5 -5
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +5 -5
- package/dist/index10.vue.d.ts +2 -2
- package/dist/index11.vue.d.cts +2 -2
- package/dist/index11.vue.d.ts +6 -6
- package/dist/index12.vue.d.cts +6 -6
- package/dist/index12.vue.d.ts +2 -2
- package/dist/index13.vue.d.cts +2 -2
- package/dist/index13.vue.d.ts +5 -5
- package/dist/index14.vue.d.cts +5 -5
- package/dist/index14.vue.d.ts +5 -5
- package/dist/index15.vue.d.cts +5 -5
- package/dist/index15.vue.d.ts +1 -1
- package/dist/index16.vue.d.cts +1 -1
- package/dist/index16.vue.d.ts +10 -1
- package/dist/index17.vue.d.cts +10 -1
- package/dist/index17.vue.d.ts +4 -4
- package/dist/index18.vue.d.cts +4 -4
- package/dist/index19.vue.d.cts +1 -1
- package/dist/index19.vue.d.ts +1 -1
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +2 -2
- package/dist/index20.vue.d.ts +2 -2
- package/dist/index21.vue.d.cts +2 -2
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +1 -1
- package/dist/index22.vue.d.ts +1 -1
- package/dist/index24.vue.d.cts +3 -3
- package/dist/index24.vue.d.ts +3 -3
- package/dist/index26.vue.d.cts +3 -3
- package/dist/index26.vue.d.ts +3 -3
- package/dist/index27.vue.d.cts +1 -1
- package/dist/index27.vue.d.ts +1 -1
- package/dist/index3.vue.d.cts +3 -3
- package/dist/index3.vue.d.ts +3 -3
- package/dist/index6.vue.d.ts +1 -1
- package/dist/index7.vue.d.cts +1 -1
- package/dist/index8.vue.d.ts +4 -4
- package/dist/index9.vue.d.cts +4 -4
- package/dist/index9.vue.d.ts +5 -5
- package/dist/mapUtils.d.cts +4 -4
- package/dist/mapUtils.d.ts +4 -4
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +76 -76
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +5 -5
- package/dist/useCollapsePanel.d.ts +5 -5
- package/dist/useCropperCore.d.cts +11 -11
- package/dist/useCropperCore.d.ts +11 -11
- package/dist/useDraggableLayout.d.cts +5 -5
- package/dist/useDraggableLayout.d.ts +5 -5
- package/dist/useDynamicFormState.d.cts +2 -2
- package/dist/useDynamicFormState.d.ts +2 -2
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useInfiniteScroll.d.cts +3 -3
- package/dist/useInfiniteScroll.d.ts +3 -3
- package/dist/useQRCode.d.cts +4 -4
- package/dist/useQRCode.d.ts +4 -4
- package/dist/useSearchState.d.cts +7 -7
- package/dist/useSearchState.d.ts +7 -7
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +5 -5
- package/dist/useSplitResize.d.ts +5 -5
- package/dist/useTimeSelection.d.cts +2 -2
- package/dist/useTimeSelection.d.ts +2 -2
- package/dist/useTreeOperations.d.cts +4 -4
- package/dist/useTreeOperations.d.ts +4 -4
- package/dist/useWorkflowValidation.d.cts +5 -5
- package/dist/useWorkflowValidation.d.ts +5 -5
- package/dist/verification.d.cts +3 -3
- package/dist/verification.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -676,3 +676,7 @@ MIT License
|
|
|
676
676
|
- [Robot Admin 在线体验](https://www.robotadmin.cn)
|
|
677
677
|
- [GitHub](https://github.com/ChenyCHENYU/naive-ui-components)
|
|
678
678
|
- [NPM](https://www.npmjs.com/package/@robot-admin/naive-ui-components)
|
|
679
|
+
|
|
680
|
+
### C_Login 扩展表单
|
|
681
|
+
|
|
682
|
+
`password-fields` 插槽位于密码输入框下方,提供 `username`、`loading`,可配置工作空间或其他业务字段。`username-change` 在初始预填、恢复记住的账号和输入变化时同步触发。宿主通过 `submitDisabled` 阻止扩展字段尚未就绪时的按钮与回车提交;`loading` 期间凭据输入禁用。公司查询、成员关系和权限始终由宿主认证服务处理,组件不保存业务上下文。
|
package/README_EN.md
CHANGED
|
@@ -616,3 +616,7 @@ MIT License
|
|
|
616
616
|
- [Robot Admin Live Demo](https://www.robotadmin.cn)
|
|
617
617
|
- [GitHub](https://github.com/ChenyCHENYU/naive-ui-components)
|
|
618
618
|
- [NPM](https://www.npmjs.com/package/@robot-admin/naive-ui-components)
|
|
619
|
+
|
|
620
|
+
### C_Login form extension
|
|
621
|
+
|
|
622
|
+
The `password-fields` slot appears below the password field and exposes `username` and `loading`. The synchronous `username-change` event covers initial defaults, remembered usernames and input changes. Use `submitDisabled` to block clicks and Enter while application fields are incomplete. Credential inputs are disabled while `loading`. Workspace discovery and authorization remain in the host application.
|
package/dist/C_Login.css
CHANGED
|
@@ -334,7 +334,7 @@ to {
|
|
|
334
334
|
* }
|
|
335
335
|
*/
|
|
336
336
|
/* ===== CSS 变量默认值(暗色玻璃风格) ===== */
|
|
337
|
-
.c-login-panel[data-v-
|
|
337
|
+
.c-login-panel[data-v-8a92d34b] {
|
|
338
338
|
/* 面板 */
|
|
339
339
|
--cl-panel-bg: rgba(255, 255, 255, 0.1);
|
|
340
340
|
--cl-panel-border: rgba(255, 255, 255, 0.18);
|
|
@@ -383,7 +383,7 @@ to {
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
/* ===== 面板容器 ===== */
|
|
386
|
-
.c-login-panel[data-v-
|
|
386
|
+
.c-login-panel[data-v-8a92d34b] {
|
|
387
387
|
width: var(--cl-panel-width);
|
|
388
388
|
background: var(--cl-panel-bg);
|
|
389
389
|
border: 1px solid var(--cl-panel-border);
|
|
@@ -396,7 +396,7 @@ to {
|
|
|
396
396
|
transition: box-shadow 0.3s ease;
|
|
397
397
|
/* 顶部光泽线 */
|
|
398
398
|
}
|
|
399
|
-
.c-login-panel[data-v-
|
|
399
|
+
.c-login-panel[data-v-8a92d34b]::before {
|
|
400
400
|
content: "";
|
|
401
401
|
position: absolute;
|
|
402
402
|
top: 0;
|
|
@@ -406,10 +406,10 @@ to {
|
|
|
406
406
|
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%);
|
|
407
407
|
pointer-events: none;
|
|
408
408
|
}
|
|
409
|
-
.c-login-panel[data-v-
|
|
409
|
+
.c-login-panel[data-v-8a92d34b] {
|
|
410
410
|
/* 玻璃内衬 */
|
|
411
411
|
}
|
|
412
|
-
.c-login-panel[data-v-
|
|
412
|
+
.c-login-panel[data-v-8a92d34b]::after {
|
|
413
413
|
content: "";
|
|
414
414
|
position: absolute;
|
|
415
415
|
inset: 0;
|
|
@@ -418,19 +418,19 @@ to {
|
|
|
418
418
|
border-radius: inherit;
|
|
419
419
|
z-index: 0;
|
|
420
420
|
}
|
|
421
|
-
.c-login-panel[data-v-
|
|
421
|
+
.c-login-panel[data-v-8a92d34b] > * {
|
|
422
422
|
position: relative;
|
|
423
423
|
z-index: 1;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
/* ===== Header ===== */
|
|
427
|
-
.c-login__header[data-v-
|
|
427
|
+
.c-login__header[data-v-8a92d34b] {
|
|
428
428
|
text-align: center;
|
|
429
429
|
margin-bottom: 10px;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
/* ===== 返回按钮(登录/注册下方块级按钮) ===== */
|
|
433
|
-
.c-login__back-btn[data-v-
|
|
433
|
+
.c-login__back-btn[data-v-8a92d34b] {
|
|
434
434
|
margin-top: 10px;
|
|
435
435
|
height: var(--cl-btn-height) !important;
|
|
436
436
|
border-radius: var(--cl-btn-radius) !important;
|
|
@@ -442,41 +442,41 @@ to {
|
|
|
442
442
|
letter-spacing: 2px;
|
|
443
443
|
transition: all 0.25s ease !important;
|
|
444
444
|
}
|
|
445
|
-
.c-login__back-btn[data-v-
|
|
445
|
+
.c-login__back-btn[data-v-8a92d34b]:hover {
|
|
446
446
|
background: rgba(255, 255, 255, 0.06) !important;
|
|
447
447
|
border-color: var(--cl-input-underline-hover) !important;
|
|
448
448
|
color: var(--cl-text-primary) !important;
|
|
449
449
|
}
|
|
450
|
-
.c-login__logo[data-v-
|
|
450
|
+
.c-login__logo[data-v-8a92d34b] {
|
|
451
451
|
display: flex;
|
|
452
452
|
justify-content: center;
|
|
453
453
|
margin-bottom: 4px;
|
|
454
454
|
}
|
|
455
|
-
.c-login__logo .c-login__logo-icon[data-v-
|
|
455
|
+
.c-login__logo .c-login__logo-icon[data-v-8a92d34b] {
|
|
456
456
|
color: var(--cl-text-primary);
|
|
457
457
|
filter: drop-shadow(0 2px 8px rgba(24, 89, 233, 0.4));
|
|
458
458
|
}
|
|
459
|
-
.c-login__title[data-v-
|
|
459
|
+
.c-login__title[data-v-8a92d34b] {
|
|
460
460
|
margin: 0 0 2px;
|
|
461
461
|
font-size: 20px;
|
|
462
462
|
font-weight: 600;
|
|
463
463
|
color: var(--cl-text-primary);
|
|
464
464
|
letter-spacing: 0.5px;
|
|
465
465
|
}
|
|
466
|
-
.c-login__subtitle[data-v-
|
|
466
|
+
.c-login__subtitle[data-v-8a92d34b] {
|
|
467
467
|
margin: 0;
|
|
468
468
|
font-size: 13px;
|
|
469
469
|
color: var(--cl-text-secondary);
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
/* ===== 登录方式切换(底部) ===== */
|
|
473
|
-
.c-login__mode-switch[data-v-
|
|
473
|
+
.c-login__mode-switch[data-v-8a92d34b] {
|
|
474
474
|
margin-top: 14px;
|
|
475
475
|
display: grid;
|
|
476
476
|
grid-template-columns: 1fr 1fr;
|
|
477
477
|
gap: 10px;
|
|
478
478
|
}
|
|
479
|
-
.c-login__mode-btn[data-v-
|
|
479
|
+
.c-login__mode-btn[data-v-8a92d34b] {
|
|
480
480
|
--n-border: none !important;
|
|
481
481
|
--n-border-hover: none !important;
|
|
482
482
|
--n-border-pressed: none !important;
|
|
@@ -489,51 +489,51 @@ to {
|
|
|
489
489
|
color: var(--cl-text-secondary) !important;
|
|
490
490
|
transition: all 0.2s ease !important;
|
|
491
491
|
}
|
|
492
|
-
.c-login__mode-btn[data-v-
|
|
492
|
+
.c-login__mode-btn[data-v-8a92d34b]:hover {
|
|
493
493
|
background: rgba(255, 255, 255, 0.1) !important;
|
|
494
494
|
color: var(--cl-text-primary) !important;
|
|
495
495
|
}
|
|
496
|
-
.c-login__mode-btn.is-active[data-v-
|
|
496
|
+
.c-login__mode-btn.is-active[data-v-8a92d34b] {
|
|
497
497
|
background: color-mix(in srgb, var(--cl-tab-bar) 22%, transparent) !important;
|
|
498
498
|
color: var(--cl-tab-active) !important;
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
/* ===== 表单 ===== */
|
|
502
|
-
.c-login__form[data-v-
|
|
502
|
+
.c-login__form[data-v-8a92d34b] {
|
|
503
503
|
margin-top: 6px;
|
|
504
504
|
}
|
|
505
|
-
.c-login__form-item[data-v-
|
|
505
|
+
.c-login__form-item[data-v-8a92d34b] {
|
|
506
506
|
margin-bottom: 6px !important;
|
|
507
507
|
/* 彻底干掉 NaiveUI FormItem 内置间距 CSS 变量 */
|
|
508
508
|
}
|
|
509
|
-
.c-login__form-item[data-v-
|
|
509
|
+
.c-login__form-item[data-v-8a92d34b] .n-form-item {
|
|
510
510
|
--n-feedback-padding: 2px 0 0 0 !important;
|
|
511
511
|
--n-feedback-height: 0 !important;
|
|
512
512
|
--n-blank-height: 0 !important;
|
|
513
513
|
--n-label-height: 0 !important;
|
|
514
514
|
}
|
|
515
|
-
.c-login__form-item[data-v-
|
|
515
|
+
.c-login__form-item[data-v-8a92d34b] .n-form-item-label {
|
|
516
516
|
display: none;
|
|
517
517
|
}
|
|
518
|
-
.c-login__form-item[data-v-
|
|
518
|
+
.c-login__form-item[data-v-8a92d34b] {
|
|
519
519
|
/* 校验信息减少占用 */
|
|
520
520
|
}
|
|
521
|
-
.c-login__form-item[data-v-
|
|
521
|
+
.c-login__form-item[data-v-8a92d34b] .n-form-item-feedback-wrapper {
|
|
522
522
|
min-height: 0 !important;
|
|
523
523
|
padding-top: 0 !important;
|
|
524
524
|
line-height: 1.4;
|
|
525
525
|
}
|
|
526
|
-
.c-login__form-item[data-v-
|
|
526
|
+
.c-login__form-item[data-v-8a92d34b] .n-form-item-feedback {
|
|
527
527
|
font-size: 11px !important;
|
|
528
528
|
line-height: 1.4;
|
|
529
529
|
}
|
|
530
|
-
.c-login__form-item[data-v-
|
|
530
|
+
.c-login__form-item[data-v-8a92d34b] .n-form-item-blank {
|
|
531
531
|
min-height: 0 !important;
|
|
532
532
|
}
|
|
533
|
-
.c-login__form-item[data-v-
|
|
533
|
+
.c-login__form-item[data-v-8a92d34b] {
|
|
534
534
|
/* 底线风格输入框 */
|
|
535
535
|
}
|
|
536
|
-
.c-login__form-item[data-v-
|
|
536
|
+
.c-login__form-item[data-v-8a92d34b] .n-input {
|
|
537
537
|
--n-border: none !important;
|
|
538
538
|
--n-border-hover: none !important;
|
|
539
539
|
--n-border-focus: none !important;
|
|
@@ -549,58 +549,58 @@ to {
|
|
|
549
549
|
padding: 5px 2px !important;
|
|
550
550
|
transition: border-color 0.25s ease;
|
|
551
551
|
}
|
|
552
|
-
.c-login__form-item[data-v-
|
|
552
|
+
.c-login__form-item[data-v-8a92d34b] .n-input:hover {
|
|
553
553
|
border-bottom-color: var(--cl-input-underline-hover) !important;
|
|
554
554
|
}
|
|
555
|
-
.c-login__form-item[data-v-
|
|
555
|
+
.c-login__form-item[data-v-8a92d34b] .n-input:focus-within {
|
|
556
556
|
border-bottom-color: var(--cl-input-underline-focus) !important;
|
|
557
557
|
}
|
|
558
|
-
.c-login__form-item[data-v-
|
|
558
|
+
.c-login__form-item[data-v-8a92d34b] .n-input .n-input__input-el {
|
|
559
559
|
color: var(--cl-input-text) !important;
|
|
560
560
|
}
|
|
561
|
-
.c-login__form-item[data-v-
|
|
561
|
+
.c-login__form-item[data-v-8a92d34b] .n-input .n-input__input-el::placeholder {
|
|
562
562
|
color: var(--cl-input-placeholder) !important;
|
|
563
563
|
}
|
|
564
|
-
.c-login__form-item[data-v-
|
|
565
|
-
.c-login__form-item[data-v-
|
|
564
|
+
.c-login__form-item[data-v-8a92d34b] .n-input .n-input__prefix,
|
|
565
|
+
.c-login__form-item[data-v-8a92d34b] .n-input .n-input__suffix {
|
|
566
566
|
color: var(--cl-input-icon) !important;
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
/* ===== 辅助行:记住我 + 忘记密码 ===== */
|
|
570
|
-
.c-login__aux-row[data-v-
|
|
570
|
+
.c-login__aux-row[data-v-8a92d34b] {
|
|
571
571
|
display: flex;
|
|
572
572
|
justify-content: space-between;
|
|
573
573
|
align-items: center;
|
|
574
574
|
margin-top: 8px;
|
|
575
575
|
margin-bottom: 14px;
|
|
576
576
|
}
|
|
577
|
-
.c-login__remember[data-v-
|
|
577
|
+
.c-login__remember[data-v-8a92d34b] .n-checkbox__label {
|
|
578
578
|
color: var(--cl-text-secondary) !important;
|
|
579
579
|
font-size: 13px;
|
|
580
580
|
}
|
|
581
|
-
.c-login__remember[data-v-
|
|
581
|
+
.c-login__remember[data-v-8a92d34b] .n-checkbox-box {
|
|
582
582
|
--n-border: 1px solid var(--cl-input-underline) !important;
|
|
583
583
|
}
|
|
584
|
-
.c-login__forgot[data-v-
|
|
584
|
+
.c-login__forgot[data-v-8a92d34b] {
|
|
585
585
|
font-size: 13px;
|
|
586
586
|
color: var(--cl-link-color);
|
|
587
587
|
cursor: pointer;
|
|
588
588
|
transition: color 0.2s ease;
|
|
589
589
|
}
|
|
590
|
-
.c-login__forgot[data-v-
|
|
590
|
+
.c-login__forgot[data-v-8a92d34b]:hover {
|
|
591
591
|
color: var(--cl-link-hover);
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
/* ===== 验证码行 ===== */
|
|
595
|
-
.c-login__code-row[data-v-
|
|
595
|
+
.c-login__code-row[data-v-8a92d34b] {
|
|
596
596
|
display: flex;
|
|
597
597
|
gap: 10px;
|
|
598
598
|
width: 100%;
|
|
599
599
|
}
|
|
600
|
-
.c-login__code-input[data-v-
|
|
600
|
+
.c-login__code-input[data-v-8a92d34b] {
|
|
601
601
|
flex: 1;
|
|
602
602
|
}
|
|
603
|
-
.c-login__send-code-btn[data-v-
|
|
603
|
+
.c-login__send-code-btn[data-v-8a92d34b] {
|
|
604
604
|
flex-shrink: 0;
|
|
605
605
|
white-space: nowrap;
|
|
606
606
|
background: rgba(255, 255, 255, 0.08) !important;
|
|
@@ -610,13 +610,13 @@ to {
|
|
|
610
610
|
font-size: 13px;
|
|
611
611
|
transition: all 0.25s ease;
|
|
612
612
|
}
|
|
613
|
-
.c-login__send-code-btn[data-v-
|
|
613
|
+
.c-login__send-code-btn[data-v-8a92d34b]:not(:disabled):hover {
|
|
614
614
|
background: rgba(255, 255, 255, 0.16) !important;
|
|
615
615
|
color: var(--cl-text-primary) !important;
|
|
616
616
|
}
|
|
617
617
|
|
|
618
618
|
/* ===== 登录按钮 ===== */
|
|
619
|
-
.c-login__submit-btn[data-v-
|
|
619
|
+
.c-login__submit-btn[data-v-8a92d34b] {
|
|
620
620
|
height: var(--cl-btn-height) !important;
|
|
621
621
|
background: var(--cl-btn-bg) !important;
|
|
622
622
|
border: none !important;
|
|
@@ -631,7 +631,7 @@ to {
|
|
|
631
631
|
margin-top: 14px;
|
|
632
632
|
/* 光泽扫过动画 */
|
|
633
633
|
}
|
|
634
|
-
.c-login__submit-btn[data-v-
|
|
634
|
+
.c-login__submit-btn[data-v-8a92d34b]::before {
|
|
635
635
|
content: "";
|
|
636
636
|
position: absolute;
|
|
637
637
|
top: 0;
|
|
@@ -642,34 +642,34 @@ to {
|
|
|
642
642
|
transform: skewX(-25deg);
|
|
643
643
|
transition: left 0.6s ease;
|
|
644
644
|
}
|
|
645
|
-
.c-login__submit-btn[data-v-
|
|
645
|
+
.c-login__submit-btn[data-v-8a92d34b]:not(:disabled):hover {
|
|
646
646
|
background: var(--cl-btn-bg-hover) !important;
|
|
647
647
|
transform: translateY(-1px);
|
|
648
648
|
box-shadow: var(--cl-btn-shadow-hover) !important;
|
|
649
649
|
}
|
|
650
|
-
.c-login__submit-btn[data-v-
|
|
650
|
+
.c-login__submit-btn[data-v-8a92d34b]:not(:disabled):hover::before {
|
|
651
651
|
left: 150%;
|
|
652
652
|
}
|
|
653
|
-
.c-login__submit-btn[data-v-
|
|
653
|
+
.c-login__submit-btn[data-v-8a92d34b]:active {
|
|
654
654
|
transform: translateY(0) !important;
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
/* ===== 人机验证 ===== */
|
|
658
|
-
.c-login__captcha-wrap[data-v-
|
|
658
|
+
.c-login__captcha-wrap[data-v-8a92d34b] {
|
|
659
659
|
margin-top: 10px;
|
|
660
660
|
display: flex;
|
|
661
661
|
justify-content: center;
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
/* ===== 扫码登录面板 ===== */
|
|
665
|
-
.c-login__qr-panel[data-v-
|
|
665
|
+
.c-login__qr-panel[data-v-8a92d34b] {
|
|
666
666
|
display: flex;
|
|
667
667
|
flex-direction: column;
|
|
668
668
|
align-items: center;
|
|
669
669
|
padding: 8px 0 4px;
|
|
670
670
|
gap: 14px;
|
|
671
671
|
}
|
|
672
|
-
.c-login__qr-frame[data-v-
|
|
672
|
+
.c-login__qr-frame[data-v-8a92d34b] {
|
|
673
673
|
position: relative;
|
|
674
674
|
width: 164px;
|
|
675
675
|
height: 164px;
|
|
@@ -678,7 +678,7 @@ to {
|
|
|
678
678
|
background: rgba(0, 0, 0, 0.35);
|
|
679
679
|
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 28px rgba(0, 0, 0, 0.4);
|
|
680
680
|
}
|
|
681
|
-
.c-login__qr-frame .c-login__qr-placeholder[data-v-
|
|
681
|
+
.c-login__qr-frame .c-login__qr-placeholder[data-v-8a92d34b] {
|
|
682
682
|
display: flex;
|
|
683
683
|
align-items: center;
|
|
684
684
|
justify-content: center;
|
|
@@ -688,10 +688,10 @@ to {
|
|
|
688
688
|
font-size: 13px;
|
|
689
689
|
text-align: center;
|
|
690
690
|
}
|
|
691
|
-
.c-login__qr-frame[data-v-
|
|
691
|
+
.c-login__qr-frame[data-v-8a92d34b] {
|
|
692
692
|
/* 扫描动画线 */
|
|
693
693
|
}
|
|
694
|
-
@keyframes qr-scan-
|
|
694
|
+
@keyframes qr-scan-8a92d34b {
|
|
695
695
|
0% {
|
|
696
696
|
transform: translateY(0);
|
|
697
697
|
opacity: 1;
|
|
@@ -707,12 +707,12 @@ to {
|
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
/* C_QRCode 居中在 frame 内 */
|
|
710
|
-
.c-login__qr-frame[data-v-
|
|
710
|
+
.c-login__qr-frame[data-v-8a92d34b] {
|
|
711
711
|
display: flex;
|
|
712
712
|
align-items: center;
|
|
713
713
|
justify-content: center;
|
|
714
714
|
}
|
|
715
|
-
.c-login__qr-scan-line[data-v-
|
|
715
|
+
.c-login__qr-scan-line[data-v-8a92d34b] {
|
|
716
716
|
position: absolute;
|
|
717
717
|
top: 10px;
|
|
718
718
|
left: 10px;
|
|
@@ -721,12 +721,12 @@ to {
|
|
|
721
721
|
background: linear-gradient(90deg, transparent 0%, rgba(24, 89, 233, 0.7) 30%, rgb(100, 160, 255) 50%, rgba(24, 89, 233, 0.7) 70%, transparent 100%);
|
|
722
722
|
border-radius: 1px;
|
|
723
723
|
box-shadow: 0 0 6px rgba(24, 89, 233, 0.8);
|
|
724
|
-
animation: qr-scan-
|
|
724
|
+
animation: qr-scan-8a92d34b 2.4s ease-in-out infinite;
|
|
725
725
|
pointer-events: none;
|
|
726
726
|
}
|
|
727
727
|
|
|
728
728
|
/* 四角刻度装饰 */
|
|
729
|
-
.c-login__qr-corner[data-v-
|
|
729
|
+
.c-login__qr-corner[data-v-8a92d34b] {
|
|
730
730
|
position: absolute;
|
|
731
731
|
width: 14px;
|
|
732
732
|
height: 14px;
|
|
@@ -734,31 +734,31 @@ to {
|
|
|
734
734
|
border-style: solid;
|
|
735
735
|
pointer-events: none;
|
|
736
736
|
}
|
|
737
|
-
.c-login__qr-corner--tl[data-v-
|
|
737
|
+
.c-login__qr-corner--tl[data-v-8a92d34b] {
|
|
738
738
|
top: 6px;
|
|
739
739
|
left: 6px;
|
|
740
740
|
border-width: 2px 0 0 2px;
|
|
741
741
|
border-radius: 3px 0 0 0;
|
|
742
742
|
}
|
|
743
|
-
.c-login__qr-corner--tr[data-v-
|
|
743
|
+
.c-login__qr-corner--tr[data-v-8a92d34b] {
|
|
744
744
|
top: 6px;
|
|
745
745
|
right: 6px;
|
|
746
746
|
border-width: 2px 2px 0 0;
|
|
747
747
|
border-radius: 0 3px 0 0;
|
|
748
748
|
}
|
|
749
|
-
.c-login__qr-corner--bl[data-v-
|
|
749
|
+
.c-login__qr-corner--bl[data-v-8a92d34b] {
|
|
750
750
|
bottom: 6px;
|
|
751
751
|
left: 6px;
|
|
752
752
|
border-width: 0 0 2px 2px;
|
|
753
753
|
border-radius: 0 0 0 3px;
|
|
754
754
|
}
|
|
755
|
-
.c-login__qr-corner--br[data-v-
|
|
755
|
+
.c-login__qr-corner--br[data-v-8a92d34b] {
|
|
756
756
|
bottom: 6px;
|
|
757
757
|
right: 6px;
|
|
758
758
|
border-width: 0 2px 2px 0;
|
|
759
759
|
border-radius: 0 0 3px 0;
|
|
760
760
|
}
|
|
761
|
-
.c-login__qr-hint[data-v-
|
|
761
|
+
.c-login__qr-hint[data-v-8a92d34b] {
|
|
762
762
|
margin: 0;
|
|
763
763
|
display: flex;
|
|
764
764
|
align-items: center;
|
|
@@ -767,22 +767,22 @@ to {
|
|
|
767
767
|
color: var(--cl-text-hint);
|
|
768
768
|
letter-spacing: 0.3px;
|
|
769
769
|
}
|
|
770
|
-
.c-login__qr-refresh[data-v-
|
|
770
|
+
.c-login__qr-refresh[data-v-8a92d34b] {
|
|
771
771
|
color: var(--cl-text-secondary) !important;
|
|
772
772
|
font-size: 11px !important;
|
|
773
773
|
}
|
|
774
|
-
.c-login__qr-refresh[data-v-
|
|
774
|
+
.c-login__qr-refresh[data-v-8a92d34b]:hover {
|
|
775
775
|
color: var(--cl-tab-bar) !important;
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
/* ===== 分割线 ===== */
|
|
779
|
-
.c-login__divider[data-v-
|
|
779
|
+
.c-login__divider[data-v-8a92d34b] {
|
|
780
780
|
margin: 12px 10px 10px !important;
|
|
781
781
|
}
|
|
782
|
-
.c-login__divider[data-v-
|
|
782
|
+
.c-login__divider[data-v-8a92d34b] .n-divider__line {
|
|
783
783
|
background: var(--cl-divider-color) !important;
|
|
784
784
|
}
|
|
785
|
-
.c-login__divider[data-v-
|
|
785
|
+
.c-login__divider[data-v-8a92d34b] .n-divider__title {
|
|
786
786
|
color: var(--cl-text-hint) !important;
|
|
787
787
|
font-size: 12px;
|
|
788
788
|
white-space: nowrap;
|
|
@@ -790,13 +790,13 @@ to {
|
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
/* ===== 社交登录 ===== */
|
|
793
|
-
.c-login__social-row[data-v-
|
|
793
|
+
.c-login__social-row[data-v-8a92d34b] {
|
|
794
794
|
display: flex;
|
|
795
795
|
justify-content: center;
|
|
796
796
|
gap: 14px;
|
|
797
797
|
margin-bottom: 6px;
|
|
798
798
|
}
|
|
799
|
-
.c-login__social-btn[data-v-
|
|
799
|
+
.c-login__social-btn[data-v-8a92d34b] {
|
|
800
800
|
width: var(--cl-social-size) !important;
|
|
801
801
|
height: var(--cl-social-size) !important;
|
|
802
802
|
background: var(--cl-social-btn-bg) !important;
|
|
@@ -804,38 +804,38 @@ to {
|
|
|
804
804
|
color: var(--cl-text-secondary) !important;
|
|
805
805
|
transition: all 0.25s ease !important;
|
|
806
806
|
}
|
|
807
|
-
.c-login__social-btn[data-v-
|
|
807
|
+
.c-login__social-btn[data-v-8a92d34b]:hover {
|
|
808
808
|
background: var(--cl-social-btn-hover-bg) !important;
|
|
809
809
|
color: var(--cl-text-primary) !important;
|
|
810
810
|
transform: translateY(-2px);
|
|
811
811
|
}
|
|
812
812
|
|
|
813
813
|
/* ===== 注册 ===== */
|
|
814
|
-
.c-login__register-row[data-v-
|
|
814
|
+
.c-login__register-row[data-v-8a92d34b] {
|
|
815
815
|
text-align: center;
|
|
816
816
|
margin-top: 14px;
|
|
817
817
|
font-size: 13px;
|
|
818
818
|
}
|
|
819
|
-
.c-login__register-hint[data-v-
|
|
819
|
+
.c-login__register-hint[data-v-8a92d34b] {
|
|
820
820
|
color: var(--cl-text-hint);
|
|
821
821
|
}
|
|
822
|
-
.c-login__register-link[data-v-
|
|
822
|
+
.c-login__register-link[data-v-8a92d34b] {
|
|
823
823
|
color: var(--cl-tab-bar);
|
|
824
824
|
cursor: pointer;
|
|
825
825
|
margin-left: 4px;
|
|
826
826
|
transition: opacity 0.2s ease;
|
|
827
827
|
}
|
|
828
|
-
.c-login__register-link[data-v-
|
|
828
|
+
.c-login__register-link[data-v-8a92d34b]:hover {
|
|
829
829
|
opacity: 0.8;
|
|
830
830
|
}
|
|
831
831
|
|
|
832
832
|
/* ===== 输入图标 ===== */
|
|
833
|
-
.c-login__input-icon[data-v-
|
|
833
|
+
.c-login__input-icon[data-v-8a92d34b] {
|
|
834
834
|
color: var(--cl-input-icon);
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
/* ===== 亮色主题预设(父级加 .c-login--light 类可切换) ===== */
|
|
838
|
-
.c-login--light .c-login-panel[data-v-
|
|
838
|
+
.c-login--light .c-login-panel[data-v-8a92d34b] {
|
|
839
839
|
--cl-panel-bg: rgba(255, 255, 255, 0.96);
|
|
840
840
|
--cl-panel-border: rgba(0, 0, 0, 0.08);
|
|
841
841
|
--cl-panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
package/dist/C_Login2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Captcha2.cjs`),r=require(`./storage.cjs`),i=require(`./C_QRCode2.cjs`);let a=require(`vue`),o=require(`naive-ui`);const s=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],c={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},ee={class:`c-login-panel`},l={class:`c-login__header`},te={key:0,class:`c-login__logo`},ne={class:`c-login__title`},re={key:0,class:`c-login__subtitle`},u={key:1,class:`c-login__subtitle c-login__subtitle--register`},d={key:0,class:`c-login__aux-row`},f={class:`c-login__code-row`},p={key:0,class:`c-login__captcha-wrap`},ie={key:3,class:`c-login__qr-panel`},ae={class:`c-login__qr-frame`},oe={key:1,class:`c-login__qr-placeholder`},m={key:2,class:`c-login__qr-scan-line`},h={class:`c-login__qr-hint`},g={class:`c-login__code-row`},_={key:7,class:`c-login__mode-switch`},v={class:`c-login__social-row`},y={key:9,class:`c-login__register-row`},b=(0,a.defineComponent)({__name:`index`,props:{title:{default:`欢迎回来`},subtitle:{},logoIcon:{},features:{},socialProviders:{},qrcodeUrl:{},storageKey:{default:`c_login_remember`},loading:{type:Boolean,default:!1},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`],setup(t,{expose:b,emit:x}){let S=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},C=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],w=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,T=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,E=t,D=x,O=(0,a.computed)(()=>({...E,features:{...c,...E.features},socialProviders:E.socialProviders??s})),k=(0,a.computed)(()=>O.value.features),A=(0,a.computed)(()=>O.value.socialProviders),j=(0,a.ref)(`password`),M=(0,a.ref)(null),N=(0,a.reactive)({username:E.defaultUsername??``,password:E.defaultPassword??``}),se={username:[{required:!0,message:S(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:S(`cl_password_rule`,`请输入密码`),trigger:`blur`}]},P=(0,a.ref)(!1);(0,a.watch)([P,()=>N.username],([e])=>{e?r.i(E.storageKey,{username:N.username}):r.r(E.storageKey)}),(0,a.onMounted)(()=>{let e=r.t(E.storageKey);typeof e?.username==`string`&&(N.username=e.username,P.value=!0)});let F=async()=>{try{await M.value?.validate()}catch{return}D(`submit`,{...N,...H.value?{captchaToken:U.value,captchaTimestamp:W.value,captchaType:G.value,captchaVerifiedBy:K.value}:{}})},I=(0,a.ref)(null),L=(0,a.reactive)({account:``,code:``}),R=(0,a.ref)(0),z=null,B={account:C(`手机号`,w,`手机号格式错误`),code:[{required:!0,message:S(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},V=(0,a.ref)(),H=(0,a.ref)(!1),U=(0,a.ref)(``),W=(0,a.ref)(0),G=(0,a.ref)(`puzzle-captcha`),K=(0,a.ref)(),ce=e=>{H.value=!0,U.value=e.token,W.value=e.timestamp,G.value=e.type,K.value=e.verifiedBy},le=()=>{H.value=!1},ue=e=>{H.value=e,e||(U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0)},de=()=>{H.value=!1,U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0,V.value?.reset()},q=async()=>{try{await I.value?.validate()}catch{return}k.value.captchaVerify&&!H.value||D(`captcha-submit`,{...L})},fe=()=>{let e=L.account.trim();R.value>0||!w.test(e)||(D(`send-code`,e),z&&=(clearInterval(z),null),R.value=60,z=setInterval(()=>{R.value--,R.value<=0&&(clearInterval(z),z=null)},1e3))},J=(0,a.computed)(()=>E.qrcodeUrl?.trim()??``),pe=()=>{D(`qrcode-refresh`)},Y=(0,a.ref)(null),X=(0,a.reactive)({phone:``,code:``,password:``,confirmPassword:``}),Z=(0,a.ref)(0),Q=null,me={phone:C(`手机号`,w,`手机号格式错误`),code:[{required:!0,message:S(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:C(`密码`,T,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:S(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===X.password?!0:Error(S(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},he=()=>{let e=X.phone.trim();Z.value>0||!w.test(e)||(D(`register-send-code`,e),Q&&=(clearInterval(Q),null),Z.value=60,Q=setInterval(()=>{Z.value--,Z.value<=0&&(clearInterval(Q),Q=null)},1e3))},$=async()=>{try{await Y.value?.validate()}catch{return}D(`register-submit`,{...X})};return(0,a.onUnmounted)(()=>{z&&=(clearInterval(z),null),Q&&=(clearInterval(Q),null)}),b({resetCaptcha:de}),(t,r)=>{let s=o.NInput,c=o.NFormItem,b=o.NCheckbox,x=o.NText,C=o.NForm,w=o.NButton,T=o.NDivider,z=o.NTooltip;return(0,a.openBlock)(),(0,a.createElementBlock)(`div`,ee,[(0,a.createCommentVNode)(` ===== Logo / 标题区 ===== `),(0,a.createElementVNode)(`div`,l,[(0,a.renderSlot)(t.$slots,`logo`,{},()=>[O.value.logoIcon?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,te,[(0,a.createVNode)(e.t,{name:O.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):(0,a.createCommentVNode)(`v-if`,!0)],!0),(0,a.createElementVNode)(`h2`,ne,(0,a.toDisplayString)(O.value.title),1),O.value.subtitle&&j.value!==`register`?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,re,(0,a.toDisplayString)(O.value.subtitle),1)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` 注册视图的副标题 `),j.value===`register`?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,u,(0,a.toDisplayString)(S(`cl_register`,`注册账号`)),1)):(0,a.createCommentVNode)(`v-if`,!0)]),(0,a.createCommentVNode)(` ===== 密码登录表单(默认视图) ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`passwordFormRef`,ref:M,model:N,rules:se,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`username`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:N.username,"onUpdate:value":r[0]||=e=>N.username=e,placeholder:S(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:N.password,"onUpdate:value":r[1]||=e=>N.password=e,type:`password`,"show-password-on":`click`,placeholder:S(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:(0,a.withKeys)(F,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createCommentVNode)(` 记住我 + 忘记密码 `),k.value.rememberMe||k.value.forgotPassword?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,d,[k.value.rememberMe?((0,a.openBlock)(),(0,a.createBlock)(b,{key:0,checked:P.value,"onUpdate:checked":r[2]||=e=>P.value=e,class:`c-login__remember`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):(0,a.createCommentVNode)(`v-if`,!0),k.value.forgotPassword?((0,a.openBlock)(),(0,a.createBlock)(x,{key:1,class:`c-login__forgot`,onClick:r[3]||=e=>D(`forgot-password`)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_forgot`,`忘记密码?`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0)])):(0,a.createCommentVNode)(`v-if`,!0)]),_:1},8,[`model`]),[[a.vShow,j.value===`password`]]),(0,a.createCommentVNode)(` ===== 验证码登录表单 ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`captchaFormRef`,ref:I,model:L,rules:B,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`account`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:L.account,"onUpdate:value":r[4]||=e=>L.account=e,placeholder:S(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,f,[(0,a.createVNode)(s,{value:L.code,"onUpdate:value":r[5]||=e=>L.code=e,placeholder:S(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:(0,a.withKeys)(q,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,a.createVNode)(w,{disabled:R.value>0||!L.account,class:`c-login__send-code-btn`,onClick:fe},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value>0?`${R.value}s ${S(`cl_resend`,`后重发`)}`:S(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[a.vShow,j.value===`captcha`]]),(0,a.createCommentVNode)(` ===== 人机验证拼图(仅密码登录模式) ===== `),k.value.captchaVerify&&j.value===`password`?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,p,[(0,a.createVNode)(n.t,{ref_key:`captchaRef`,ref:V,theme:`dark`,provider:E.captchaProvider,"challenge-url":E.captchaChallengeUrl,verifier:E.captchaVerifier,"require-server-verification":E.requireCaptchaServerVerification,"verification-timeout":E.captchaVerificationTimeout,onSuccess:ce,onFail:le,onChange:ue,onVisibleChange:r[6]||=e=>D(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 登录按钮(密码和验证码模式) ===== `),j.value===`password`||j.value===`captcha`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:1,type:`primary`,block:``,loading:E.loading,disabled:j.value===`password`&&k.value.captchaVerify&&!H.value,class:`c-login__submit-btn`,onClick:r[7]||=e=>j.value===`password`?F():q()},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(j.value===`password`&&k.value.captchaVerify&&!H.value?S(`cl_verify_first`,`请先完成人机验证`):S(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 返回按钮(验证码子视图) ===== `),j.value===`captcha`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:2,block:``,class:`c-login__back-btn`,onClick:r[8]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 扫码登录面板 ===== `),j.value===`qrcode`?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,ie,[(0,a.createElementVNode)(`div`,ae,[J.value?((0,a.openBlock)(),(0,a.createBlock)(i.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,a.openBlock)(),(0,a.createElementBlock)(`div`,oe,(0,a.toDisplayString)(S(`cl_qr_missing`,`请配置二维码地址`)),1)),J.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,m)):(0,a.createCommentVNode)(`v-if`,!0),r[18]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),r[19]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),r[20]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),r[21]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),(0,a.createElementVNode)(`p`,h,[(0,a.createVNode)(e.t,{name:`mdi:cellphone-check`,size:13}),(0,a.createTextVNode)(` `+(0,a.toDisplayString)(S(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),(0,a.createVNode)(w,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:pe},{icon:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:refresh`,size:12})]),default:(0,a.withCtx)(()=>[(0,a.createTextVNode)(` `+(0,a.toDisplayString)(S(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),j.value===`qrcode`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:4,block:``,class:`c-login__back-btn`,onClick:r[9]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册表单 ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`registerFormRef`,ref:Y,model:X,rules:me,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`phone`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.phone,"onUpdate:value":r[10]||=e=>X.phone=e,placeholder:S(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,g,[(0,a.createVNode)(s,{value:X.code,"onUpdate:value":r[11]||=e=>X.code=e,placeholder:S(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,a.createVNode)(w,{disabled:Z.value>0||!X.phone,class:`c-login__send-code-btn`,onClick:he},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(Z.value>0?`${Z.value}s ${S(`cl_resend`,`后重发`)}`:S(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),(0,a.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.password,"onUpdate:value":r[12]||=e=>X.password=e,type:`password`,"show-password-on":`click`,placeholder:S(`cl_password_ph`,`请输入密码`)},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`confirmPassword`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.confirmPassword,"onUpdate:value":r[13]||=e=>X.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:S(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:(0,a.withKeys)($,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[a.vShow,j.value===`register`]]),(0,a.createCommentVNode)(` ===== 注册确认按钮 ===== `),j.value===`register`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:5,type:`primary`,block:``,loading:E.loading,class:`c-login__submit-btn`,onClick:$},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册视图返回按钮 ===== `),j.value===`register`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:6,block:``,class:`c-login__back-btn`,onClick:r[14]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),j.value===`password`&&(k.value.captchaLogin||k.value.qrcodeLogin)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,_,[k.value.captchaLogin?((0,a.openBlock)(),(0,a.createBlock)(w,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:r[15]||=e=>j.value=`captcha`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),k.value.qrcodeLogin?((0,a.openBlock)(),(0,a.createBlock)(w,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:r[16]||=e=>j.value=`qrcode`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_qr_login`,`扫码登录`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0)])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),j.value===`password`&&k.value.socialLogin&&A.value.length?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:8},[(0,a.createVNode)(T,{class:`c-login__divider`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_social_login`,`其他账号登录`)),1)]),_:1}),(0,a.createElementVNode)(`div`,v,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(A.value,t=>((0,a.openBlock)(),(0,a.createBlock)(z,{key:t.key,trigger:`hover`,placement:`top`},{trigger:(0,a.withCtx)(()=>[(0,a.createVNode)(w,{circle:``,class:`c-login__social-btn`,onClick:e=>D(`social-login`,t.key)},{icon:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:t.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:(0,a.withCtx)(()=>[(0,a.createTextVNode)(` `+(0,a.toDisplayString)(t.label),1)]),_:2},1024))),128))])],64)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册入口(仅密码登录默认视图显示) ===== `),j.value===`password`&&k.value.register?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,y,[(0,a.createVNode)(x,{class:`c-login__register-hint`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_no_account`,`还没有账号?`)),1)]),_:1}),(0,a.createVNode)(x,{class:`c-login__register-link`,onClick:r[17]||=e=>j.value=`register`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_register`,`注册账号`)),1)]),_:1})])):(0,a.createCommentVNode)(`v-if`,!0)])}}});var x=t.t(b,[[`__scopeId`,`data-v-73103033`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return x}});
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`),n=require(`./C_Captcha2.cjs`),r=require(`./storage.cjs`),i=require(`./C_QRCode2.cjs`);let a=require(`vue`),o=require(`naive-ui`);const s=[{key:`github`,label:`GitHub`,icon:`mdi:github`},{key:`wechat`,label:`微信`,icon:`mdi:wechat`},{key:`qq`,label:`QQ`,icon:`mdi:qqchat`}],c={passwordLogin:!0,captchaLogin:!0,qrcodeLogin:!0,socialLogin:!0,register:!0,captchaVerify:!0,rememberMe:!0,forgotPassword:!0},ee={class:`c-login-panel`},l={class:`c-login__header`},te={key:0,class:`c-login__logo`},ne={class:`c-login__title`},re={key:0,class:`c-login__subtitle`},u={key:1,class:`c-login__subtitle c-login__subtitle--register`},d={key:0,class:`c-login__aux-row`},f={class:`c-login__code-row`},p={key:0,class:`c-login__captcha-wrap`},ie={key:3,class:`c-login__qr-panel`},ae={class:`c-login__qr-frame`},oe={key:1,class:`c-login__qr-placeholder`},m={key:2,class:`c-login__qr-scan-line`},h={class:`c-login__qr-hint`},g={class:`c-login__code-row`},_={key:7,class:`c-login__mode-switch`},v={class:`c-login__social-row`},y={key:9,class:`c-login__register-row`},b=(0,a.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:b,emit:x}){let S=(e,t)=>{let n=globalThis.$t;return n?.(e,t,`robot_admin`)??t},C=(e,t,n)=>[{required:!0,message:`${e}不能为空`,trigger:`blur`},{validator:(e,n)=>!n||typeof n==`string`&&t.test(n),message:n,trigger:`blur`}],w=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,T=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{6,20}$/,E=t,D=x,O=(0,a.computed)(()=>({...E,features:{...c,...E.features},socialProviders:E.socialProviders??s})),k=(0,a.computed)(()=>O.value.features),A=(0,a.computed)(()=>O.value.socialProviders),j=(0,a.ref)(`password`),M=(0,a.ref)(null),N=(0,a.reactive)({username:E.defaultUsername??``,password:E.defaultPassword??``}),se={username:[{required:!0,message:S(`cl_username_rule`,`请输入用户名`),trigger:`blur`}],password:[{required:!0,message:S(`cl_password_rule`,`请输入密码`),trigger:`blur`}]};(0,a.watch)(()=>N.username,e=>D(`username-change`,e),{immediate:!0,flush:`sync`});let P=(0,a.ref)(!1);(0,a.watch)([P,()=>N.username],([e])=>{e?r.i(E.storageKey,{username:N.username}):r.r(E.storageKey)}),(0,a.onMounted)(()=>{let e=r.t(E.storageKey);typeof e?.username==`string`&&(N.username=e.username,P.value=!0)});let F=async()=>{if(!(E.loading||E.submitDisabled||k.value.captchaVerify&&!H.value)){try{await M.value?.validate()}catch{return}E.loading||E.submitDisabled||k.value.captchaVerify&&!H.value||D(`submit`,{...N,...H.value?{captchaToken:U.value,captchaTimestamp:W.value,captchaType:G.value,captchaVerifiedBy:K.value}:{}})}},I=(0,a.ref)(null),L=(0,a.reactive)({account:``,code:``}),R=(0,a.ref)(0),z=null,B={account:C(`手机号`,w,`手机号格式错误`),code:[{required:!0,message:S(`cl_code_rule`,`请输入验证码`),trigger:`blur`}]},V=(0,a.ref)(),H=(0,a.ref)(!1),U=(0,a.ref)(``),W=(0,a.ref)(0),G=(0,a.ref)(`puzzle-captcha`),K=(0,a.ref)(),ce=e=>{H.value=!0,U.value=e.token,W.value=e.timestamp,G.value=e.type,K.value=e.verifiedBy},le=()=>{H.value=!1},ue=e=>{H.value=e,e||(U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0)},de=()=>{H.value=!1,U.value=``,W.value=0,G.value=`puzzle-captcha`,K.value=void 0,V.value?.reset()},q=async()=>{if(!(E.loading||E.submitDisabled)){try{await I.value?.validate()}catch{return}k.value.captchaVerify&&!H.value||D(`captcha-submit`,{...L})}},fe=()=>{let e=L.account.trim();R.value>0||!w.test(e)||(D(`send-code`,e),z&&=(clearInterval(z),null),R.value=60,z=setInterval(()=>{R.value--,R.value<=0&&(clearInterval(z),z=null)},1e3))},J=(0,a.computed)(()=>E.qrcodeUrl?.trim()??``),pe=()=>{D(`qrcode-refresh`)},Y=(0,a.ref)(null),X=(0,a.reactive)({phone:``,code:``,password:``,confirmPassword:``}),Z=(0,a.ref)(0),Q=null,me={phone:C(`手机号`,w,`手机号格式错误`),code:[{required:!0,message:S(`cl_code_rule`,`请输入验证码`),trigger:`blur`}],password:C(`密码`,T,`密码必须包含大小写字母和数字,长度6-20位`),confirmPassword:[{required:!0,message:S(`cl_confirm_pw_rule`,`请再次输入密码`),trigger:`blur`},{validator:(e,t)=>t===X.password?!0:Error(S(`cl_pw_mismatch`,`两次密码输入不一致`)),trigger:`blur`}]},he=()=>{let e=X.phone.trim();Z.value>0||!w.test(e)||(D(`register-send-code`,e),Q&&=(clearInterval(Q),null),Z.value=60,Q=setInterval(()=>{Z.value--,Z.value<=0&&(clearInterval(Q),Q=null)},1e3))},$=async()=>{try{await Y.value?.validate()}catch{return}D(`register-submit`,{...X})};return(0,a.onUnmounted)(()=>{z&&=(clearInterval(z),null),Q&&=(clearInterval(Q),null)}),b({resetCaptcha:de}),(t,r)=>{let s=o.NInput,c=o.NFormItem,b=o.NCheckbox,x=o.NText,C=o.NForm,w=o.NButton,T=o.NDivider,z=o.NTooltip;return(0,a.openBlock)(),(0,a.createElementBlock)(`div`,ee,[(0,a.createCommentVNode)(` ===== Logo / 标题区 ===== `),(0,a.createElementVNode)(`div`,l,[(0,a.renderSlot)(t.$slots,`logo`,{},()=>[O.value.logoIcon?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,te,[(0,a.createVNode)(e.t,{name:O.value.logoIcon,size:36,class:`c-login__logo-icon`},null,8,[`name`])])):(0,a.createCommentVNode)(`v-if`,!0)],!0),(0,a.createElementVNode)(`h2`,ne,(0,a.toDisplayString)(O.value.title),1),O.value.subtitle&&j.value!==`register`?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,re,(0,a.toDisplayString)(O.value.subtitle),1)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` 注册视图的副标题 `),j.value===`register`?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,u,(0,a.toDisplayString)(S(`cl_register`,`注册账号`)),1)):(0,a.createCommentVNode)(`v-if`,!0)]),(0,a.createCommentVNode)(` ===== 密码登录表单(默认视图) ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`passwordFormRef`,ref:M,model:N,rules:se,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`username`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:N.username,"onUpdate:value":r[0]||=e=>N.username=e,disabled:E.loading,placeholder:S(`cl_username_ph`,`请输入用户名`),clearable:``},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:account-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:N.password,"onUpdate:value":r[1]||=e=>N.password=e,disabled:E.loading,type:`password`,"show-password-on":`click`,placeholder:S(`cl_password_ph`,`请输入密码`),clearable:``,onKeyup:(0,a.withKeys)(F,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`disabled`,`placeholder`])]),_:1}),(0,a.createCommentVNode)(` 宿主扩展字段只获得账号与忙碌状态,不暴露密码。 `),(0,a.renderSlot)(t.$slots,`password-fields`,{username:N.username,loading:E.loading},void 0,!0),(0,a.createCommentVNode)(` 记住我 + 忘记密码 `),k.value.rememberMe||k.value.forgotPassword?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,d,[k.value.rememberMe?((0,a.openBlock)(),(0,a.createBlock)(b,{key:0,checked:P.value,"onUpdate:checked":r[2]||=e=>P.value=e,class:`c-login__remember`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_remember`,`记住我`)),1)]),_:1},8,[`checked`])):(0,a.createCommentVNode)(`v-if`,!0),k.value.forgotPassword?((0,a.openBlock)(),(0,a.createBlock)(x,{key:1,class:`c-login__forgot`,onClick:r[3]||=e=>D(`forgot-password`)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_forgot`,`忘记密码?`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0)])):(0,a.createCommentVNode)(`v-if`,!0)]),_:3},8,[`model`]),[[a.vShow,j.value===`password`]]),(0,a.createCommentVNode)(` ===== 验证码登录表单 ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`captchaFormRef`,ref:I,model:L,rules:B,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`account`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:L.account,"onUpdate:value":r[4]||=e=>L.account=e,placeholder:S(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,f,[(0,a.createVNode)(s,{value:L.code,"onUpdate:value":r[5]||=e=>L.code=e,placeholder:S(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`,onKeyup:(0,a.withKeys)(q,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,a.createVNode)(w,{disabled:R.value>0||!L.account,class:`c-login__send-code-btn`,onClick:fe},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(R.value>0?`${R.value}s ${S(`cl_resend`,`后重发`)}`:S(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`model`]),[[a.vShow,j.value===`captcha`]]),(0,a.createCommentVNode)(` ===== 人机验证拼图(仅密码登录模式) ===== `),k.value.captchaVerify&&j.value===`password`?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,p,[(0,a.createVNode)(n.t,{ref_key:`captchaRef`,ref:V,theme:`dark`,provider:E.captchaProvider,"challenge-url":E.captchaChallengeUrl,verifier:E.captchaVerifier,"require-server-verification":E.requireCaptchaServerVerification,"verification-timeout":E.captchaVerificationTimeout,onSuccess:ce,onFail:le,onChange:ue,onVisibleChange:r[6]||=e=>D(`captcha-visible-change`,e)},null,8,[`provider`,`challenge-url`,`verifier`,`require-server-verification`,`verification-timeout`])])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 登录按钮(密码和验证码模式) ===== `),j.value===`password`||j.value===`captcha`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:1,type:`primary`,block:``,loading:E.loading,disabled:E.loading||E.submitDisabled||j.value===`password`&&k.value.captchaVerify&&!H.value,class:`c-login__submit-btn`,onClick:r[7]||=e=>j.value===`password`?F():q()},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(j.value===`password`&&k.value.captchaVerify&&!H.value?S(`cl_verify_first`,`请先完成人机验证`):S(`cl_login_btn`,`登 录`)),1)]),_:1},8,[`loading`,`disabled`])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 返回按钮(验证码子视图) ===== `),j.value===`captcha`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:2,block:``,class:`c-login__back-btn`,onClick:r[8]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 扫码登录面板 ===== `),j.value===`qrcode`?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,ie,[(0,a.createElementVNode)(`div`,ae,[J.value?((0,a.openBlock)(),(0,a.createBlock)(i.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,a.openBlock)(),(0,a.createElementBlock)(`div`,oe,(0,a.toDisplayString)(S(`cl_qr_missing`,`请配置二维码地址`)),1)),J.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,m)):(0,a.createCommentVNode)(`v-if`,!0),r[18]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tl`},null,-1),r[19]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--tr`},null,-1),r[20]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--bl`},null,-1),r[21]||=(0,a.createElementVNode)(`div`,{class:`c-login__qr-corner c-login__qr-corner--br`},null,-1)]),(0,a.createElementVNode)(`p`,h,[(0,a.createVNode)(e.t,{name:`mdi:cellphone-check`,size:13}),(0,a.createTextVNode)(` `+(0,a.toDisplayString)(S(`cl_qr_hint`,`打开手机扫码后点击「确认」即可登录`)),1)]),(0,a.createVNode)(w,{text:``,size:`tiny`,class:`c-login__qr-refresh`,onClick:pe},{icon:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:refresh`,size:12})]),default:(0,a.withCtx)(()=>[(0,a.createTextVNode)(` `+(0,a.toDisplayString)(S(`cl_qr_refresh`,`二维码已失效?点击刷新`)),1)]),_:1})])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 返回按钮(扫码子视图,在二维码下方) ===== `),j.value===`qrcode`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:4,block:``,class:`c-login__back-btn`,onClick:r[9]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册表单 ===== `),(0,a.withDirectives)((0,a.createVNode)(C,{ref_key:`registerFormRef`,ref:Y,model:X,rules:me,class:`c-login__form`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(c,{path:`phone`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.phone,"onUpdate:value":r[10]||=e=>X.phone=e,placeholder:S(`cl_phone_ph`,`请输入手机号`),clearable:``,maxlength:`11`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:cellphone`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`code`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,g,[(0,a.createVNode)(s,{value:X.code,"onUpdate:value":r[11]||=e=>X.code=e,placeholder:S(`cl_code_ph`,`请输入验证码`),clearable:``,class:`c-login__code-input`},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:shield-key-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`]),(0,a.createVNode)(w,{disabled:Z.value>0||!X.phone,class:`c-login__send-code-btn`,onClick:he},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(Z.value>0?`${Z.value}s ${S(`cl_resend`,`后重发`)}`:S(`cl_get_code`,`获取验证码`)),1)]),_:1},8,[`disabled`])])]),_:1}),(0,a.createVNode)(c,{path:`password`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.password,"onUpdate:value":r[12]||=e=>X.password=e,type:`password`,"show-password-on":`click`,placeholder:S(`cl_password_ph`,`请输入密码`)},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1}),(0,a.createVNode)(c,{path:`confirmPassword`,class:`c-login__form-item`},{default:(0,a.withCtx)(()=>[(0,a.createVNode)(s,{value:X.confirmPassword,"onUpdate:value":r[13]||=e=>X.confirmPassword=e,type:`password`,"show-password-on":`click`,placeholder:S(`cl_confirm_pw_ph`,`请再次输入密码`),onKeyup:(0,a.withKeys)($,[`enter`])},{prefix:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:`mdi:lock-check-outline`,size:16,class:`c-login__input-icon`})]),_:1},8,[`value`,`placeholder`])]),_:1})]),_:1},8,[`model`]),[[a.vShow,j.value===`register`]]),(0,a.createCommentVNode)(` ===== 注册确认按钮 ===== `),j.value===`register`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:5,type:`primary`,block:``,loading:E.loading,class:`c-login__submit-btn`,onClick:$},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_confirm`,`确认`)),1)]),_:1},8,[`loading`])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册视图返回按钮 ===== `),j.value===`register`?((0,a.openBlock)(),(0,a.createBlock)(w,{key:6,block:``,class:`c-login__back-btn`,onClick:r[14]||=e=>j.value=`password`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_back`,`返回`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 登录方式切换(仅密码登录默认视图显示) ===== `),j.value===`password`&&(k.value.captchaLogin||k.value.qrcodeLogin)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,_,[k.value.captchaLogin?((0,a.openBlock)(),(0,a.createBlock)(w,{key:0,class:`c-login__mode-btn`,size:`small`,onClick:r[15]||=e=>j.value=`captcha`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_captcha_login`,`验证码登录`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0),k.value.qrcodeLogin?((0,a.openBlock)(),(0,a.createBlock)(w,{key:1,class:`c-login__mode-btn`,size:`small`,onClick:r[16]||=e=>j.value=`qrcode`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_qr_login`,`扫码登录`)),1)]),_:1})):(0,a.createCommentVNode)(`v-if`,!0)])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 其他登录方式(仅密码登录默认视图显示) ===== `),j.value===`password`&&k.value.socialLogin&&A.value.length?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:8},[(0,a.createVNode)(T,{class:`c-login__divider`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_social_login`,`其他账号登录`)),1)]),_:1}),(0,a.createElementVNode)(`div`,v,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(A.value,t=>((0,a.openBlock)(),(0,a.createBlock)(z,{key:t.key,trigger:`hover`,placement:`top`},{trigger:(0,a.withCtx)(()=>[(0,a.createVNode)(w,{circle:``,class:`c-login__social-btn`,onClick:e=>D(`social-login`,t.key)},{icon:(0,a.withCtx)(()=>[(0,a.createVNode)(e.t,{name:t.icon,size:16},null,8,[`name`])]),_:2},1032,[`onClick`])]),default:(0,a.withCtx)(()=>[(0,a.createTextVNode)(` `+(0,a.toDisplayString)(t.label),1)]),_:2},1024))),128))])],64)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.createCommentVNode)(` ===== 注册入口(仅密码登录默认视图显示) ===== `),j.value===`password`&&k.value.register?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,y,[(0,a.createVNode)(x,{class:`c-login__register-hint`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_no_account`,`还没有账号?`)),1)]),_:1}),(0,a.createVNode)(x,{class:`c-login__register-link`,onClick:r[17]||=e=>j.value=`register`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(S(`cl_register`,`注册账号`)),1)]),_:1})])):(0,a.createCommentVNode)(`v-if`,!0)])}}});var x=t.t(b,[[`__scopeId`,`data-v-8a92d34b`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return x}});
|