feat(登录): 添加用户信息认证工具函数并重构登录逻辑
refactor: 将登录页面的用户信息处理逻辑提取到独立工具函数 test: 添加用户信息认证工具函数的单元测试 chore: 添加vitest测试框架及相关依赖
Showing
7 changed files
with
390 additions
and
18 deletions
| 1 | ### | 1 | ### |
| 2 | # @Date: 2025-03-20 23:40:15 | 2 | # @Date: 2025-03-20 23:40:15 |
| 3 | # @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | # @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - # @LastEditTime: 2025-12-02 18:34:41 | 4 | + # @LastEditTime: 2025-12-09 21:05:15 |
| 5 | # @FilePath: /mlaj/.env.development | 5 | # @FilePath: /mlaj/.env.development |
| 6 | # @Description: 文件描述 | 6 | # @Description: 文件描述 |
| 7 | ### | 7 | ### | ... | ... |
| ... | @@ -7,6 +7,7 @@ | ... | @@ -7,6 +7,7 @@ |
| 7 | "dev": ". ~/.nvm/nvm.sh && nvm use 18.19.1 && vite", | 7 | "dev": ". ~/.nvm/nvm.sh && nvm use 18.19.1 && vite", |
| 8 | "build": ". ~/.nvm/nvm.sh && nvm use 18.19.1 && vite build", | 8 | "build": ". ~/.nvm/nvm.sh && nvm use 18.19.1 && vite build", |
| 9 | "preview": "vite preview", | 9 | "preview": "vite preview", |
| 10 | + "test": "vitest run", | ||
| 10 | "tar": "tar -czvpf dist.tar.gz mlaj", | 11 | "tar": "tar -czvpf dist.tar.gz mlaj", |
| 11 | "build_tar": "npm run build && npm run tar", | 12 | "build_tar": "npm run build && npm run tar", |
| 12 | "scp-dev": "scp dist.tar.gz ipadbiz-inner:/opt/space-dev/f", | 13 | "scp-dev": "scp dist.tar.gz ipadbiz-inner:/opt/space-dev/f", |
| ... | @@ -62,6 +63,7 @@ | ... | @@ -62,6 +63,7 @@ |
| 62 | "tailwindcss": "^3.4.1", | 63 | "tailwindcss": "^3.4.1", |
| 63 | "unplugin-auto-import": "^19.1.1", | 64 | "unplugin-auto-import": "^19.1.1", |
| 64 | "unplugin-vue-components": "^28.4.1", | 65 | "unplugin-vue-components": "^28.4.1", |
| 65 | - "vite": "^6.2.0" | 66 | + "vite": "^6.2.0", |
| 67 | + "vitest": "^3.2.0" | ||
| 66 | } | 68 | } |
| 67 | } | 69 | } | ... | ... |
| ... | @@ -129,6 +129,9 @@ importers: | ... | @@ -129,6 +129,9 @@ importers: |
| 129 | vite: | 129 | vite: |
| 130 | specifier: ^6.2.0 | 130 | specifier: ^6.2.0 |
| 131 | version: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | 131 | version: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) |
| 132 | + vitest: | ||
| 133 | + specifier: ^3.2.0 | ||
| 134 | + version: 3.2.4(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | ||
| 132 | 135 | ||
| 133 | packages: | 136 | packages: |
| 134 | 137 | ||
| ... | @@ -608,6 +611,12 @@ packages: | ... | @@ -608,6 +611,12 @@ packages: |
| 608 | '@sunsetglow/vue-pdf-viewer@0.3.72': | 611 | '@sunsetglow/vue-pdf-viewer@0.3.72': |
| 609 | resolution: {integrity: sha512-on1Ma1tEIKShQjWCnFMWqijOhAsiIYjQMCm+b7ISDOAQDen6icqQLj++PvrObKeQda9Tuq+l+lkwqk4Z2acDJw==} | 612 | resolution: {integrity: sha512-on1Ma1tEIKShQjWCnFMWqijOhAsiIYjQMCm+b7ISDOAQDen6icqQLj++PvrObKeQda9Tuq+l+lkwqk4Z2acDJw==} |
| 610 | 613 | ||
| 614 | + '@types/chai@5.2.3': | ||
| 615 | + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} | ||
| 616 | + | ||
| 617 | + '@types/deep-eql@4.0.2': | ||
| 618 | + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} | ||
| 619 | + | ||
| 611 | '@types/estree@1.0.8': | 620 | '@types/estree@1.0.8': |
| 612 | resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} | 621 | resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} |
| 613 | 622 | ||
| ... | @@ -665,6 +674,35 @@ packages: | ... | @@ -665,6 +674,35 @@ packages: |
| 665 | vite: ^5.0.0 || ^6.0.0 | 674 | vite: ^5.0.0 || ^6.0.0 |
| 666 | vue: ^3.2.25 | 675 | vue: ^3.2.25 |
| 667 | 676 | ||
| 677 | + '@vitest/expect@3.2.4': | ||
| 678 | + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} | ||
| 679 | + | ||
| 680 | + '@vitest/mocker@3.2.4': | ||
| 681 | + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} | ||
| 682 | + peerDependencies: | ||
| 683 | + msw: ^2.4.9 | ||
| 684 | + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 | ||
| 685 | + peerDependenciesMeta: | ||
| 686 | + msw: | ||
| 687 | + optional: true | ||
| 688 | + vite: | ||
| 689 | + optional: true | ||
| 690 | + | ||
| 691 | + '@vitest/pretty-format@3.2.4': | ||
| 692 | + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} | ||
| 693 | + | ||
| 694 | + '@vitest/runner@3.2.4': | ||
| 695 | + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} | ||
| 696 | + | ||
| 697 | + '@vitest/snapshot@3.2.4': | ||
| 698 | + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} | ||
| 699 | + | ||
| 700 | + '@vitest/spy@3.2.4': | ||
| 701 | + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} | ||
| 702 | + | ||
| 703 | + '@vitest/utils@3.2.4': | ||
| 704 | + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} | ||
| 705 | + | ||
| 668 | '@vue-office/docx@1.6.3': | 706 | '@vue-office/docx@1.6.3': |
| 669 | resolution: {integrity: sha512-Cs+3CAaRBOWOiW4XAhTwwxJ0dy8cPIf6DqfNvYcD3YACiLwO4kuawLF2IAXxyijhbuOeoFsfvoVbOc16A/4bZA==} | 707 | resolution: {integrity: sha512-Cs+3CAaRBOWOiW4XAhTwwxJ0dy8cPIf6DqfNvYcD3YACiLwO4kuawLF2IAXxyijhbuOeoFsfvoVbOc16A/4bZA==} |
| 670 | peerDependencies: | 708 | peerDependencies: |
| ... | @@ -810,6 +848,10 @@ packages: | ... | @@ -810,6 +848,10 @@ packages: |
| 810 | array-tree-filter@2.1.0: | 848 | array-tree-filter@2.1.0: |
| 811 | resolution: {integrity: sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==} | 849 | resolution: {integrity: sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==} |
| 812 | 850 | ||
| 851 | + assertion-error@2.0.1: | ||
| 852 | + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} | ||
| 853 | + engines: {node: '>=12'} | ||
| 854 | + | ||
| 813 | async-validator@4.2.5: | 855 | async-validator@4.2.5: |
| 814 | resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} | 856 | resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} |
| 815 | 857 | ||
| ... | @@ -856,6 +898,10 @@ packages: | ... | @@ -856,6 +898,10 @@ packages: |
| 856 | engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} | 898 | engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} |
| 857 | hasBin: true | 899 | hasBin: true |
| 858 | 900 | ||
| 901 | + cac@6.7.14: | ||
| 902 | + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} | ||
| 903 | + engines: {node: '>=8'} | ||
| 904 | + | ||
| 859 | call-bind-apply-helpers@1.0.2: | 905 | call-bind-apply-helpers@1.0.2: |
| 860 | resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} | 906 | resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} |
| 861 | engines: {node: '>= 0.4'} | 907 | engines: {node: '>= 0.4'} |
| ... | @@ -879,6 +925,14 @@ packages: | ... | @@ -879,6 +925,14 @@ packages: |
| 879 | resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} | 925 | resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} |
| 880 | engines: {node: '>=6'} | 926 | engines: {node: '>=6'} |
| 881 | 927 | ||
| 928 | + chai@5.3.3: | ||
| 929 | + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} | ||
| 930 | + engines: {node: '>=18'} | ||
| 931 | + | ||
| 932 | + check-error@2.1.1: | ||
| 933 | + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} | ||
| 934 | + engines: {node: '>= 16'} | ||
| 935 | + | ||
| 882 | chokidar@3.6.0: | 936 | chokidar@3.6.0: |
| 883 | resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} | 937 | resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} |
| 884 | engines: {node: '>= 8.10.0'} | 938 | engines: {node: '>= 8.10.0'} |
| ... | @@ -968,6 +1022,10 @@ packages: | ... | @@ -968,6 +1022,10 @@ packages: |
| 968 | resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==} | 1022 | resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==} |
| 969 | engines: {node: '>=8'} | 1023 | engines: {node: '>=8'} |
| 970 | 1024 | ||
| 1025 | + deep-eql@5.0.2: | ||
| 1026 | + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} | ||
| 1027 | + engines: {node: '>=6'} | ||
| 1028 | + | ||
| 971 | delayed-stream@1.0.0: | 1029 | delayed-stream@1.0.0: |
| 972 | resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} | 1030 | resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} |
| 973 | engines: {node: '>=0.4.0'} | 1031 | engines: {node: '>=0.4.0'} |
| ... | @@ -1023,6 +1081,9 @@ packages: | ... | @@ -1023,6 +1081,9 @@ packages: |
| 1023 | resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} | 1081 | resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} |
| 1024 | engines: {node: '>= 0.4'} | 1082 | engines: {node: '>= 0.4'} |
| 1025 | 1083 | ||
| 1084 | + es-module-lexer@1.7.0: | ||
| 1085 | + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} | ||
| 1086 | + | ||
| 1026 | es-object-atoms@1.1.1: | 1087 | es-object-atoms@1.1.1: |
| 1027 | resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} | 1088 | resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} |
| 1028 | engines: {node: '>= 0.4'} | 1089 | engines: {node: '>= 0.4'} |
| ... | @@ -1050,6 +1111,10 @@ packages: | ... | @@ -1050,6 +1111,10 @@ packages: |
| 1050 | estree-walker@3.0.3: | 1111 | estree-walker@3.0.3: |
| 1051 | resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} | 1112 | resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} |
| 1052 | 1113 | ||
| 1114 | + expect-type@1.3.0: | ||
| 1115 | + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} | ||
| 1116 | + engines: {node: '>=12.0.0'} | ||
| 1117 | + | ||
| 1053 | exsolve@1.0.8: | 1118 | exsolve@1.0.8: |
| 1054 | resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} | 1119 | resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} |
| 1055 | 1120 | ||
| ... | @@ -1290,6 +1355,9 @@ packages: | ... | @@ -1290,6 +1355,9 @@ packages: |
| 1290 | resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} | 1355 | resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} |
| 1291 | hasBin: true | 1356 | hasBin: true |
| 1292 | 1357 | ||
| 1358 | + loupe@3.2.1: | ||
| 1359 | + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} | ||
| 1360 | + | ||
| 1293 | lru-cache@5.1.1: | 1361 | lru-cache@5.1.1: |
| 1294 | resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} | 1362 | resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} |
| 1295 | 1363 | ||
| ... | @@ -1474,6 +1542,10 @@ packages: | ... | @@ -1474,6 +1542,10 @@ packages: |
| 1474 | pathe@2.0.3: | 1542 | pathe@2.0.3: |
| 1475 | resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} | 1543 | resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} |
| 1476 | 1544 | ||
| 1545 | + pathval@2.0.1: | ||
| 1546 | + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} | ||
| 1547 | + engines: {node: '>= 14.16'} | ||
| 1548 | + | ||
| 1477 | pdf-vue3@1.0.12: | 1549 | pdf-vue3@1.0.12: |
| 1478 | resolution: {integrity: sha512-7SMTx1RfRwdc+2WPniDzqM8MxJLqTNNzdyV0SeQTxeRLJGndb5Wv/fz5afO13oBSIvvaqcbZ/S3gF+XjqkSb9g==} | 1550 | resolution: {integrity: sha512-7SMTx1RfRwdc+2WPniDzqM8MxJLqTNNzdyV0SeQTxeRLJGndb5Wv/fz5afO13oBSIvvaqcbZ/S3gF+XjqkSb9g==} |
| 1479 | 1551 | ||
| ... | @@ -1691,6 +1763,9 @@ packages: | ... | @@ -1691,6 +1763,9 @@ packages: |
| 1691 | resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} | 1763 | resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} |
| 1692 | engines: {node: '>= 0.4'} | 1764 | engines: {node: '>= 0.4'} |
| 1693 | 1765 | ||
| 1766 | + siginfo@2.0.0: | ||
| 1767 | + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} | ||
| 1768 | + | ||
| 1694 | signal-exit@3.0.7: | 1769 | signal-exit@3.0.7: |
| 1695 | resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} | 1770 | resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} |
| 1696 | 1771 | ||
| ... | @@ -1711,6 +1786,12 @@ packages: | ... | @@ -1711,6 +1786,12 @@ packages: |
| 1711 | spark-md5@2.0.2: | 1786 | spark-md5@2.0.2: |
| 1712 | resolution: {integrity: sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==} | 1787 | resolution: {integrity: sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==} |
| 1713 | 1788 | ||
| 1789 | + stackback@0.0.2: | ||
| 1790 | + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} | ||
| 1791 | + | ||
| 1792 | + std-env@3.10.0: | ||
| 1793 | + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} | ||
| 1794 | + | ||
| 1714 | string-width@4.2.3: | 1795 | string-width@4.2.3: |
| 1715 | resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} | 1796 | resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} |
| 1716 | engines: {node: '>=8'} | 1797 | engines: {node: '>=8'} |
| ... | @@ -1764,10 +1845,28 @@ packages: | ... | @@ -1764,10 +1845,28 @@ packages: |
| 1764 | resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==} | 1845 | resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==} |
| 1765 | engines: {node: '>=12.22'} | 1846 | engines: {node: '>=12.22'} |
| 1766 | 1847 | ||
| 1848 | + tinybench@2.9.0: | ||
| 1849 | + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} | ||
| 1850 | + | ||
| 1851 | + tinyexec@0.3.2: | ||
| 1852 | + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} | ||
| 1853 | + | ||
| 1767 | tinyglobby@0.2.15: | 1854 | tinyglobby@0.2.15: |
| 1768 | resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} | 1855 | resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} |
| 1769 | engines: {node: '>=12.0.0'} | 1856 | engines: {node: '>=12.0.0'} |
| 1770 | 1857 | ||
| 1858 | + tinypool@1.1.1: | ||
| 1859 | + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} | ||
| 1860 | + engines: {node: ^18.0.0 || >=20.0.0} | ||
| 1861 | + | ||
| 1862 | + tinyrainbow@2.0.0: | ||
| 1863 | + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} | ||
| 1864 | + engines: {node: '>=14.0.0'} | ||
| 1865 | + | ||
| 1866 | + tinyspy@4.0.4: | ||
| 1867 | + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} | ||
| 1868 | + engines: {node: '>=14.0.0'} | ||
| 1869 | + | ||
| 1771 | to-regex-range@5.0.1: | 1870 | to-regex-range@5.0.1: |
| 1772 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} | 1871 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} |
| 1773 | engines: {node: '>=8.0'} | 1872 | engines: {node: '>=8.0'} |
| ... | @@ -1864,6 +1963,11 @@ packages: | ... | @@ -1864,6 +1963,11 @@ packages: |
| 1864 | videojs-vtt.js@0.15.5: | 1963 | videojs-vtt.js@0.15.5: |
| 1865 | resolution: {integrity: sha512-yZbBxvA7QMYn15Lr/ZfhhLPrNpI/RmCSCqgIff57GC2gIrV5YfyzLfLyZMj0NnZSAz8syB4N0nHXpZg9MyrMOQ==} | 1964 | resolution: {integrity: sha512-yZbBxvA7QMYn15Lr/ZfhhLPrNpI/RmCSCqgIff57GC2gIrV5YfyzLfLyZMj0NnZSAz8syB4N0nHXpZg9MyrMOQ==} |
| 1866 | 1965 | ||
| 1966 | + vite-node@3.2.4: | ||
| 1967 | + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} | ||
| 1968 | + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} | ||
| 1969 | + hasBin: true | ||
| 1970 | + | ||
| 1867 | vite-plugin-static-copy@1.0.6: | 1971 | vite-plugin-static-copy@1.0.6: |
| 1868 | resolution: {integrity: sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==} | 1972 | resolution: {integrity: sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==} |
| 1869 | engines: {node: ^18.0.0 || >=20.0.0} | 1973 | engines: {node: ^18.0.0 || >=20.0.0} |
| ... | @@ -1910,6 +2014,34 @@ packages: | ... | @@ -1910,6 +2014,34 @@ packages: |
| 1910 | yaml: | 2014 | yaml: |
| 1911 | optional: true | 2015 | optional: true |
| 1912 | 2016 | ||
| 2017 | + vitest@3.2.4: | ||
| 2018 | + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} | ||
| 2019 | + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} | ||
| 2020 | + hasBin: true | ||
| 2021 | + peerDependencies: | ||
| 2022 | + '@edge-runtime/vm': '*' | ||
| 2023 | + '@types/debug': ^4.1.12 | ||
| 2024 | + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 | ||
| 2025 | + '@vitest/browser': 3.2.4 | ||
| 2026 | + '@vitest/ui': 3.2.4 | ||
| 2027 | + happy-dom: '*' | ||
| 2028 | + jsdom: '*' | ||
| 2029 | + peerDependenciesMeta: | ||
| 2030 | + '@edge-runtime/vm': | ||
| 2031 | + optional: true | ||
| 2032 | + '@types/debug': | ||
| 2033 | + optional: true | ||
| 2034 | + '@types/node': | ||
| 2035 | + optional: true | ||
| 2036 | + '@vitest/browser': | ||
| 2037 | + optional: true | ||
| 2038 | + '@vitest/ui': | ||
| 2039 | + optional: true | ||
| 2040 | + happy-dom: | ||
| 2041 | + optional: true | ||
| 2042 | + jsdom: | ||
| 2043 | + optional: true | ||
| 2044 | + | ||
| 1913 | vue-demi@0.14.6: | 2045 | vue-demi@0.14.6: |
| 1914 | resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} | 2046 | resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} |
| 1915 | engines: {node: '>=12'} | 2047 | engines: {node: '>=12'} |
| ... | @@ -1962,6 +2094,11 @@ packages: | ... | @@ -1962,6 +2094,11 @@ packages: |
| 1962 | which-module@2.0.1: | 2094 | which-module@2.0.1: |
| 1963 | resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} | 2095 | resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} |
| 1964 | 2096 | ||
| 2097 | + why-is-node-running@2.3.0: | ||
| 2098 | + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} | ||
| 2099 | + engines: {node: '>=8'} | ||
| 2100 | + hasBin: true | ||
| 2101 | + | ||
| 1965 | wide-align@1.1.5: | 2102 | wide-align@1.1.5: |
| 1966 | resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} | 2103 | resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} |
| 1967 | 2104 | ||
| ... | @@ -2411,6 +2548,13 @@ snapshots: | ... | @@ -2411,6 +2548,13 @@ snapshots: |
| 2411 | - typescript | 2548 | - typescript |
| 2412 | - vite | 2549 | - vite |
| 2413 | 2550 | ||
| 2551 | + '@types/chai@5.2.3': | ||
| 2552 | + dependencies: | ||
| 2553 | + '@types/deep-eql': 4.0.2 | ||
| 2554 | + assertion-error: 2.0.1 | ||
| 2555 | + | ||
| 2556 | + '@types/deep-eql@4.0.2': {} | ||
| 2557 | + | ||
| 2414 | '@types/estree@1.0.8': {} | 2558 | '@types/estree@1.0.8': {} |
| 2415 | 2559 | ||
| 2416 | '@types/node@20.19.25': | 2560 | '@types/node@20.19.25': |
| ... | @@ -2474,6 +2618,48 @@ snapshots: | ... | @@ -2474,6 +2618,48 @@ snapshots: |
| 2474 | vite: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | 2618 | vite: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) |
| 2475 | vue: 3.5.25 | 2619 | vue: 3.5.25 |
| 2476 | 2620 | ||
| 2621 | + '@vitest/expect@3.2.4': | ||
| 2622 | + dependencies: | ||
| 2623 | + '@types/chai': 5.2.3 | ||
| 2624 | + '@vitest/spy': 3.2.4 | ||
| 2625 | + '@vitest/utils': 3.2.4 | ||
| 2626 | + chai: 5.3.3 | ||
| 2627 | + tinyrainbow: 2.0.0 | ||
| 2628 | + | ||
| 2629 | + '@vitest/mocker@3.2.4(vite@6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2))': | ||
| 2630 | + dependencies: | ||
| 2631 | + '@vitest/spy': 3.2.4 | ||
| 2632 | + estree-walker: 3.0.3 | ||
| 2633 | + magic-string: 0.30.21 | ||
| 2634 | + optionalDependencies: | ||
| 2635 | + vite: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | ||
| 2636 | + | ||
| 2637 | + '@vitest/pretty-format@3.2.4': | ||
| 2638 | + dependencies: | ||
| 2639 | + tinyrainbow: 2.0.0 | ||
| 2640 | + | ||
| 2641 | + '@vitest/runner@3.2.4': | ||
| 2642 | + dependencies: | ||
| 2643 | + '@vitest/utils': 3.2.4 | ||
| 2644 | + pathe: 2.0.3 | ||
| 2645 | + strip-literal: 3.1.0 | ||
| 2646 | + | ||
| 2647 | + '@vitest/snapshot@3.2.4': | ||
| 2648 | + dependencies: | ||
| 2649 | + '@vitest/pretty-format': 3.2.4 | ||
| 2650 | + magic-string: 0.30.21 | ||
| 2651 | + pathe: 2.0.3 | ||
| 2652 | + | ||
| 2653 | + '@vitest/spy@3.2.4': | ||
| 2654 | + dependencies: | ||
| 2655 | + tinyspy: 4.0.4 | ||
| 2656 | + | ||
| 2657 | + '@vitest/utils@3.2.4': | ||
| 2658 | + dependencies: | ||
| 2659 | + '@vitest/pretty-format': 3.2.4 | ||
| 2660 | + loupe: 3.2.1 | ||
| 2661 | + tinyrainbow: 2.0.0 | ||
| 2662 | + | ||
| 2477 | '@vue-office/docx@1.6.3(vue-demi@0.14.6(vue@3.5.25))(vue@3.5.25)': | 2663 | '@vue-office/docx@1.6.3(vue-demi@0.14.6(vue@3.5.25))(vue@3.5.25)': |
| 2478 | dependencies: | 2664 | dependencies: |
| 2479 | vue: 3.5.25 | 2665 | vue: 3.5.25 |
| ... | @@ -2660,6 +2846,8 @@ snapshots: | ... | @@ -2660,6 +2846,8 @@ snapshots: |
| 2660 | 2846 | ||
| 2661 | array-tree-filter@2.1.0: {} | 2847 | array-tree-filter@2.1.0: {} |
| 2662 | 2848 | ||
| 2849 | + assertion-error@2.0.1: {} | ||
| 2850 | + | ||
| 2663 | async-validator@4.2.5: {} | 2851 | async-validator@4.2.5: {} |
| 2664 | 2852 | ||
| 2665 | asynckit@0.4.0: {} | 2853 | asynckit@0.4.0: {} |
| ... | @@ -2713,6 +2901,8 @@ snapshots: | ... | @@ -2713,6 +2901,8 @@ snapshots: |
| 2713 | node-releases: 2.0.27 | 2901 | node-releases: 2.0.27 |
| 2714 | update-browserslist-db: 1.2.2(browserslist@4.28.1) | 2902 | update-browserslist-db: 1.2.2(browserslist@4.28.1) |
| 2715 | 2903 | ||
| 2904 | + cac@6.7.14: {} | ||
| 2905 | + | ||
| 2716 | call-bind-apply-helpers@1.0.2: | 2906 | call-bind-apply-helpers@1.0.2: |
| 2717 | dependencies: | 2907 | dependencies: |
| 2718 | es-errors: 1.3.0 | 2908 | es-errors: 1.3.0 |
| ... | @@ -2739,6 +2929,16 @@ snapshots: | ... | @@ -2739,6 +2929,16 @@ snapshots: |
| 2739 | - supports-color | 2929 | - supports-color |
| 2740 | optional: true | 2930 | optional: true |
| 2741 | 2931 | ||
| 2932 | + chai@5.3.3: | ||
| 2933 | + dependencies: | ||
| 2934 | + assertion-error: 2.0.1 | ||
| 2935 | + check-error: 2.1.1 | ||
| 2936 | + deep-eql: 5.0.2 | ||
| 2937 | + loupe: 3.2.1 | ||
| 2938 | + pathval: 2.0.1 | ||
| 2939 | + | ||
| 2940 | + check-error@2.1.1: {} | ||
| 2941 | + | ||
| 2742 | chokidar@3.6.0: | 2942 | chokidar@3.6.0: |
| 2743 | dependencies: | 2943 | dependencies: |
| 2744 | anymatch: 3.1.3 | 2944 | anymatch: 3.1.3 |
| ... | @@ -2818,6 +3018,8 @@ snapshots: | ... | @@ -2818,6 +3018,8 @@ snapshots: |
| 2818 | mimic-response: 2.1.0 | 3018 | mimic-response: 2.1.0 |
| 2819 | optional: true | 3019 | optional: true |
| 2820 | 3020 | ||
| 3021 | + deep-eql@5.0.2: {} | ||
| 3022 | + | ||
| 2821 | delayed-stream@1.0.0: {} | 3023 | delayed-stream@1.0.0: {} |
| 2822 | 3024 | ||
| 2823 | delegates@1.0.0: | 3025 | delegates@1.0.0: |
| ... | @@ -2859,6 +3061,8 @@ snapshots: | ... | @@ -2859,6 +3061,8 @@ snapshots: |
| 2859 | 3061 | ||
| 2860 | es-errors@1.3.0: {} | 3062 | es-errors@1.3.0: {} |
| 2861 | 3063 | ||
| 3064 | + es-module-lexer@1.7.0: {} | ||
| 3065 | + | ||
| 2862 | es-object-atoms@1.1.1: | 3066 | es-object-atoms@1.1.1: |
| 2863 | dependencies: | 3067 | dependencies: |
| 2864 | es-errors: 1.3.0 | 3068 | es-errors: 1.3.0 |
| ... | @@ -2909,6 +3113,8 @@ snapshots: | ... | @@ -2909,6 +3113,8 @@ snapshots: |
| 2909 | dependencies: | 3113 | dependencies: |
| 2910 | '@types/estree': 1.0.8 | 3114 | '@types/estree': 1.0.8 |
| 2911 | 3115 | ||
| 3116 | + expect-type@1.3.0: {} | ||
| 3117 | + | ||
| 2912 | exsolve@1.0.8: {} | 3118 | exsolve@1.0.8: {} |
| 2913 | 3119 | ||
| 2914 | fast-glob@3.3.3: | 3120 | fast-glob@3.3.3: |
| ... | @@ -3154,6 +3360,8 @@ snapshots: | ... | @@ -3154,6 +3360,8 @@ snapshots: |
| 3154 | dependencies: | 3360 | dependencies: |
| 3155 | js-tokens: 4.0.0 | 3361 | js-tokens: 4.0.0 |
| 3156 | 3362 | ||
| 3363 | + loupe@3.2.1: {} | ||
| 3364 | + | ||
| 3157 | lru-cache@5.1.1: | 3365 | lru-cache@5.1.1: |
| 3158 | dependencies: | 3366 | dependencies: |
| 3159 | yallist: 3.1.1 | 3367 | yallist: 3.1.1 |
| ... | @@ -3326,6 +3534,8 @@ snapshots: | ... | @@ -3326,6 +3534,8 @@ snapshots: |
| 3326 | 3534 | ||
| 3327 | pathe@2.0.3: {} | 3535 | pathe@2.0.3: {} |
| 3328 | 3536 | ||
| 3537 | + pathval@2.0.1: {} | ||
| 3538 | + | ||
| 3329 | pdf-vue3@1.0.12: {} | 3539 | pdf-vue3@1.0.12: {} |
| 3330 | 3540 | ||
| 3331 | pdfjs-dist@3.4.120: | 3541 | pdfjs-dist@3.4.120: |
| ... | @@ -3558,6 +3768,8 @@ snapshots: | ... | @@ -3558,6 +3768,8 @@ snapshots: |
| 3558 | side-channel-map: 1.0.1 | 3768 | side-channel-map: 1.0.1 |
| 3559 | side-channel-weakmap: 1.0.2 | 3769 | side-channel-weakmap: 1.0.2 |
| 3560 | 3770 | ||
| 3771 | + siginfo@2.0.0: {} | ||
| 3772 | + | ||
| 3561 | signal-exit@3.0.7: | 3773 | signal-exit@3.0.7: |
| 3562 | optional: true | 3774 | optional: true |
| 3563 | 3775 | ||
| ... | @@ -3578,6 +3790,10 @@ snapshots: | ... | @@ -3578,6 +3790,10 @@ snapshots: |
| 3578 | 3790 | ||
| 3579 | spark-md5@2.0.2: {} | 3791 | spark-md5@2.0.2: {} |
| 3580 | 3792 | ||
| 3793 | + stackback@0.0.2: {} | ||
| 3794 | + | ||
| 3795 | + std-env@3.10.0: {} | ||
| 3796 | + | ||
| 3581 | string-width@4.2.3: | 3797 | string-width@4.2.3: |
| 3582 | dependencies: | 3798 | dependencies: |
| 3583 | emoji-regex: 8.0.0 | 3799 | emoji-regex: 8.0.0 |
| ... | @@ -3665,11 +3881,21 @@ snapshots: | ... | @@ -3665,11 +3881,21 @@ snapshots: |
| 3665 | 3881 | ||
| 3666 | throttle-debounce@5.0.2: {} | 3882 | throttle-debounce@5.0.2: {} |
| 3667 | 3883 | ||
| 3884 | + tinybench@2.9.0: {} | ||
| 3885 | + | ||
| 3886 | + tinyexec@0.3.2: {} | ||
| 3887 | + | ||
| 3668 | tinyglobby@0.2.15: | 3888 | tinyglobby@0.2.15: |
| 3669 | dependencies: | 3889 | dependencies: |
| 3670 | fdir: 6.5.0(picomatch@4.0.3) | 3890 | fdir: 6.5.0(picomatch@4.0.3) |
| 3671 | picomatch: 4.0.3 | 3891 | picomatch: 4.0.3 |
| 3672 | 3892 | ||
| 3893 | + tinypool@1.1.1: {} | ||
| 3894 | + | ||
| 3895 | + tinyrainbow@2.0.0: {} | ||
| 3896 | + | ||
| 3897 | + tinyspy@4.0.4: {} | ||
| 3898 | + | ||
| 3673 | to-regex-range@5.0.1: | 3899 | to-regex-range@5.0.1: |
| 3674 | dependencies: | 3900 | dependencies: |
| 3675 | is-number: 7.0.0 | 3901 | is-number: 7.0.0 |
| ... | @@ -3795,6 +4021,27 @@ snapshots: | ... | @@ -3795,6 +4021,27 @@ snapshots: |
| 3795 | dependencies: | 4021 | dependencies: |
| 3796 | global: 4.4.0 | 4022 | global: 4.4.0 |
| 3797 | 4023 | ||
| 4024 | + vite-node@3.2.4(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2): | ||
| 4025 | + dependencies: | ||
| 4026 | + cac: 6.7.14 | ||
| 4027 | + debug: 4.4.3 | ||
| 4028 | + es-module-lexer: 1.7.0 | ||
| 4029 | + pathe: 2.0.3 | ||
| 4030 | + vite: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | ||
| 4031 | + transitivePeerDependencies: | ||
| 4032 | + - '@types/node' | ||
| 4033 | + - jiti | ||
| 4034 | + - less | ||
| 4035 | + - lightningcss | ||
| 4036 | + - sass | ||
| 4037 | + - sass-embedded | ||
| 4038 | + - stylus | ||
| 4039 | + - sugarss | ||
| 4040 | + - supports-color | ||
| 4041 | + - terser | ||
| 4042 | + - tsx | ||
| 4043 | + - yaml | ||
| 4044 | + | ||
| 3798 | vite-plugin-static-copy@1.0.6(vite@6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2)): | 4045 | vite-plugin-static-copy@1.0.6(vite@6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2)): |
| 3799 | dependencies: | 4046 | dependencies: |
| 3800 | chokidar: 3.6.0 | 4047 | chokidar: 3.6.0 |
| ... | @@ -3817,6 +4064,47 @@ snapshots: | ... | @@ -3817,6 +4064,47 @@ snapshots: |
| 3817 | jiti: 1.21.7 | 4064 | jiti: 1.21.7 |
| 3818 | less: 4.4.2 | 4065 | less: 4.4.2 |
| 3819 | 4066 | ||
| 4067 | + vitest@3.2.4(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2): | ||
| 4068 | + dependencies: | ||
| 4069 | + '@types/chai': 5.2.3 | ||
| 4070 | + '@vitest/expect': 3.2.4 | ||
| 4071 | + '@vitest/mocker': 3.2.4(vite@6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2)) | ||
| 4072 | + '@vitest/pretty-format': 3.2.4 | ||
| 4073 | + '@vitest/runner': 3.2.4 | ||
| 4074 | + '@vitest/snapshot': 3.2.4 | ||
| 4075 | + '@vitest/spy': 3.2.4 | ||
| 4076 | + '@vitest/utils': 3.2.4 | ||
| 4077 | + chai: 5.3.3 | ||
| 4078 | + debug: 4.4.3 | ||
| 4079 | + expect-type: 1.3.0 | ||
| 4080 | + magic-string: 0.30.21 | ||
| 4081 | + pathe: 2.0.3 | ||
| 4082 | + picomatch: 4.0.3 | ||
| 4083 | + std-env: 3.10.0 | ||
| 4084 | + tinybench: 2.9.0 | ||
| 4085 | + tinyexec: 0.3.2 | ||
| 4086 | + tinyglobby: 0.2.15 | ||
| 4087 | + tinypool: 1.1.1 | ||
| 4088 | + tinyrainbow: 2.0.0 | ||
| 4089 | + vite: 6.4.1(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | ||
| 4090 | + vite-node: 3.2.4(@types/node@20.19.25)(jiti@1.21.7)(less@4.4.2) | ||
| 4091 | + why-is-node-running: 2.3.0 | ||
| 4092 | + optionalDependencies: | ||
| 4093 | + '@types/node': 20.19.25 | ||
| 4094 | + transitivePeerDependencies: | ||
| 4095 | + - jiti | ||
| 4096 | + - less | ||
| 4097 | + - lightningcss | ||
| 4098 | + - msw | ||
| 4099 | + - sass | ||
| 4100 | + - sass-embedded | ||
| 4101 | + - stylus | ||
| 4102 | + - sugarss | ||
| 4103 | + - supports-color | ||
| 4104 | + - terser | ||
| 4105 | + - tsx | ||
| 4106 | + - yaml | ||
| 4107 | + | ||
| 3820 | vue-demi@0.14.6(vue@3.5.25): | 4108 | vue-demi@0.14.6(vue@3.5.25): |
| 3821 | dependencies: | 4109 | dependencies: |
| 3822 | vue: 3.5.25 | 4110 | vue: 3.5.25 |
| ... | @@ -3860,6 +4148,11 @@ snapshots: | ... | @@ -3860,6 +4148,11 @@ snapshots: |
| 3860 | 4148 | ||
| 3861 | which-module@2.0.1: {} | 4149 | which-module@2.0.1: {} |
| 3862 | 4150 | ||
| 4151 | + why-is-node-running@2.3.0: | ||
| 4152 | + dependencies: | ||
| 4153 | + siginfo: 2.0.0 | ||
| 4154 | + stackback: 0.0.2 | ||
| 4155 | + | ||
| 3863 | wide-align@1.1.5: | 4156 | wide-align@1.1.5: |
| 3864 | dependencies: | 4157 | dependencies: |
| 3865 | string-width: 4.2.3 | 4158 | string-width: 4.2.3 | ... | ... |
src/utils/__tests__/auth_user_info.test.js
0 → 100644
| 1 | +import { describe, expect, it, vi } from 'vitest' | ||
| 2 | +import { applyUserInfoAuth } from '../auth_user_info' | ||
| 3 | + | ||
| 4 | +const createStorage = () => { | ||
| 5 | + const store = {} | ||
| 6 | + return { | ||
| 7 | + store, | ||
| 8 | + setItem: vi.fn((key, value) => { | ||
| 9 | + store[key] = value | ||
| 10 | + }), | ||
| 11 | + getItem: vi.fn((key) => store[key] ?? null), | ||
| 12 | + removeItem: vi.fn((key) => { | ||
| 13 | + delete store[key] | ||
| 14 | + }), | ||
| 15 | + clear: vi.fn(() => { | ||
| 16 | + Object.keys(store).forEach((key) => delete store[key]) | ||
| 17 | + }) | ||
| 18 | + } | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +describe('applyUserInfoAuth', () => { | ||
| 22 | + it('从 response.data.user_info 写入鉴权与缓存', () => { | ||
| 23 | + const storage = createStorage() | ||
| 24 | + const set_auth_headers = vi.fn() | ||
| 25 | + const response = { | ||
| 26 | + data: { | ||
| 27 | + user_info: { | ||
| 28 | + user_id: '100', | ||
| 29 | + HTTP_USER_TOKEN: 'token-xxx', | ||
| 30 | + user_name: '张三' | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + const ok = applyUserInfoAuth(response, { storage, set_auth_headers }) | ||
| 36 | + | ||
| 37 | + expect(ok).toBe(true) | ||
| 38 | + expect(set_auth_headers).toHaveBeenCalledTimes(1) | ||
| 39 | + expect(set_auth_headers).toHaveBeenCalledWith('100', 'token-xxx') | ||
| 40 | + expect(storage.setItem).toHaveBeenCalledTimes(1) | ||
| 41 | + expect(storage.setItem).toHaveBeenCalledWith('user_info', JSON.stringify(response.data.user_info)) | ||
| 42 | + }) | ||
| 43 | + | ||
| 44 | + it('缺少 user_id 或 HTTP_USER_TOKEN 时不做任何写入', () => { | ||
| 45 | + const storage = createStorage() | ||
| 46 | + const set_auth_headers = vi.fn() | ||
| 47 | + | ||
| 48 | + const ok = applyUserInfoAuth({ user_id: '100' }, { storage, set_auth_headers }) | ||
| 49 | + | ||
| 50 | + expect(ok).toBe(false) | ||
| 51 | + expect(set_auth_headers).not.toHaveBeenCalled() | ||
| 52 | + expect(storage.setItem).not.toHaveBeenCalled() | ||
| 53 | + }) | ||
| 54 | + | ||
| 55 | + it('支持直接传入 user_info 对象', () => { | ||
| 56 | + const storage = createStorage() | ||
| 57 | + const set_auth_headers = vi.fn() | ||
| 58 | + const user_info = { user_id: 1, HTTP_USER_TOKEN: 't' } | ||
| 59 | + | ||
| 60 | + const ok = applyUserInfoAuth(user_info, { storage, set_auth_headers }) | ||
| 61 | + | ||
| 62 | + expect(ok).toBe(true) | ||
| 63 | + expect(set_auth_headers).toHaveBeenCalledWith(1, 't') | ||
| 64 | + expect(storage.setItem).toHaveBeenCalledWith('user_info', JSON.stringify(user_info)) | ||
| 65 | + }) | ||
| 66 | +}) |
src/utils/auth_user_info.js
0 → 100644
| 1 | +export const applyUserInfoAuth = (input, options = {}) => { | ||
| 2 | + const user_info = input && input.data && input.data.user_info ? input.data.user_info : input | ||
| 3 | + if (!user_info || typeof user_info !== 'object') { | ||
| 4 | + return false | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + const { user_id, HTTP_USER_TOKEN } = user_info | ||
| 8 | + if (!user_id || !HTTP_USER_TOKEN) { | ||
| 9 | + return false | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + const set_auth_headers = options.set_auth_headers | ||
| 13 | + if (typeof set_auth_headers === 'function') { | ||
| 14 | + set_auth_headers(user_id, HTTP_USER_TOKEN) | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + const storage = Object.prototype.hasOwnProperty.call(options, 'storage') ? options.storage : globalThis.localStorage | ||
| 18 | + if (storage && typeof storage.setItem === 'function') { | ||
| 19 | + storage.setItem('user_info', JSON.stringify(user_info || {})) | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + return true | ||
| 23 | +} |
| ... | @@ -192,6 +192,7 @@ import { smsAPI } from "@/api/common"; | ... | @@ -192,6 +192,7 @@ import { smsAPI } from "@/api/common"; |
| 192 | import { showToast } from "vant"; | 192 | import { showToast } from "vant"; |
| 193 | import UserAgreement from "@/components/ui/UserAgreement.vue"; | 193 | import UserAgreement from "@/components/ui/UserAgreement.vue"; |
| 194 | import { setAuthHeaders } from "@/utils/axios"; | 194 | import { setAuthHeaders } from "@/utils/axios"; |
| 195 | +import { applyUserInfoAuth } from "@/utils/auth_user_info"; | ||
| 195 | import weixinLogo from '@/assets/images/weixin_logo_lg.jpeg' | 196 | import weixinLogo from '@/assets/images/weixin_logo_lg.jpeg' |
| 196 | import { startWxAuth } from '@/router/guards' | 197 | import { startWxAuth } from '@/router/guards' |
| 197 | import { wxInfo } from '@/utils/tools' | 198 | import { wxInfo } from '@/utils/tools' |
| ... | @@ -310,14 +311,7 @@ const handleSubmit = async () => { | ... | @@ -310,14 +311,7 @@ const handleSubmit = async () => { |
| 310 | error.value = response.msg || "登录失败,请检查您的输入项"; | 311 | error.value = response.msg || "登录失败,请检查您的输入项"; |
| 311 | return; | 312 | return; |
| 312 | } else { | 313 | } else { |
| 313 | - // 获取data里面的 user_id, HTTP_USER_TOKEN, 并设置到后面所有的请求头里面,headers.User-Id, headers.User-Token | 314 | + applyUserInfoAuth(response, { set_auth_headers: setAuthHeaders, storage: localStorage }) |
| 314 | - const { user_id, HTTP_USER_TOKEN } = response?.data?.user_info || {}; | ||
| 315 | - if (user_id && HTTP_USER_TOKEN) { | ||
| 316 | - // 设置认证请求头 | ||
| 317 | - setAuthHeaders(user_id, HTTP_USER_TOKEN); | ||
| 318 | - // 缓存user_info | ||
| 319 | - localStorage.setItem('user_info', JSON.stringify(response?.data?.user_info || {})); | ||
| 320 | - } | ||
| 321 | } | 315 | } |
| 322 | 316 | ||
| 323 | const { code, data } = await getUserInfoAPI(); | 317 | const { code, data } = await getUserInfoAPI(); | ... | ... |
| ... | @@ -90,6 +90,7 @@ import { showToast } from 'vant' | ... | @@ -90,6 +90,7 @@ import { showToast } from 'vant' |
| 90 | import { useTitle } from '@vueuse/core' | 90 | import { useTitle } from '@vueuse/core' |
| 91 | import { setAuthHeaders } from "@/utils/axios"; | 91 | import { setAuthHeaders } from "@/utils/axios"; |
| 92 | import VideoBackground from '@/components/ui/VideoBackground.vue' | 92 | import VideoBackground from '@/components/ui/VideoBackground.vue' |
| 93 | +import { applyUserInfoAuth } from '@/utils/auth_user_info' | ||
| 93 | 94 | ||
| 94 | // 导入接口 | 95 | // 导入接口 |
| 95 | import { smsAPI } from '@/api/common' | 96 | import { smsAPI } from '@/api/common' |
| ... | @@ -172,14 +173,7 @@ const handleLogin = async () => { | ... | @@ -172,14 +173,7 @@ const handleLogin = async () => { |
| 172 | try { | 173 | try { |
| 173 | const res = await loginAPI({ mobile: phone.value, sms_code: code.value, entry: entry.value, referrer_user_id: referrer_user_id.value }) | 174 | const res = await loginAPI({ mobile: phone.value, sms_code: code.value, entry: entry.value, referrer_user_id: referrer_user_id.value }) |
| 174 | if (res.code) { | 175 | if (res.code) { |
| 175 | - // 获取data里面的 user_id, HTTP_USER_TOKEN, 并设置到后面所有的请求头里面,headers.User-Id, headers.User-Token | 176 | + applyUserInfoAuth(res, { set_auth_headers: setAuthHeaders, storage: localStorage }) |
| 176 | - const { user_id, HTTP_USER_TOKEN } = res?.data?.user_info || {}; | ||
| 177 | - if (user_id && HTTP_USER_TOKEN) { | ||
| 178 | - // 设置认证请求头 | ||
| 179 | - setAuthHeaders(user_id, HTTP_USER_TOKEN); | ||
| 180 | - // 缓存user_info | ||
| 181 | - localStorage.setItem('user_info', JSON.stringify(res?.data?.user_info || {})); | ||
| 182 | - } | ||
| 183 | const userInfo = await userInfoAPI() | 177 | const userInfo = await userInfoAPI() |
| 184 | // 登录之后需要判断是否有完善个人信息 | 178 | // 登录之后需要判断是否有完善个人信息 |
| 185 | if (userInfo.code) { | 179 | if (userInfo.code) { | ... | ... |
-
Please register or login to post a comment