Przeglądaj źródła

fix: resolve TypeScript build errors and update dependencies

- Update typescript to 5.6.3 and vue-tsc to 2.1.10 for compatibility
- Fix audit page date picker type (null -> undefined)
- Fix unused variable in api mocks
- Update camera tests to use fixtures with proper types
- Add .gitignore entries for TypeScript build artifacts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
yb 3 tygodni temu
rodzic
commit
e4b644f099

+ 7 - 0
.gitignore

@@ -27,3 +27,10 @@ dist-ssr
 playwright-report/
 test-results/
 coverage/
+
+# TypeScript build info
+*.tsbuildinfo
+
+# Compiled JavaScript (from vue-tsc)
+src/**/*.js
+tests/**/*.js

+ 2 - 2
package.json

@@ -59,12 +59,12 @@
     "husky": "^6.0.0",
     "lint-staged": "^10.5.4",
     "prettier": "^2.8.8",
-    "typescript": "~5.0.4",
+    "typescript": "~5.6.3",
     "unplugin-auto-import": "^0.19.0",
     "unplugin-vue-components": "^0.28.0",
     "vite": "5.3.1",
     "vite-plugin-vue-devtools": "^7.7.0",
     "vitest": "^4.0.16",
-    "vue-tsc": "2.0.21"
+    "vue-tsc": "2.1.10"
   }
 }

+ 135 - 129
pnpm-lock.yaml

@@ -10,28 +10,28 @@ importers:
     dependencies:
       '@element-plus/icons-vue':
         specifier: ^2.1.0
-        version: 2.3.2(vue@3.5.26(typescript@5.0.4))
+        version: 2.3.2(vue@3.5.26(typescript@5.6.3))
       axios:
         specifier: ^1.4.0
         version: 1.13.2
       element-plus:
         specifier: 2.7.5
-        version: 2.7.5(vue@3.5.26(typescript@5.0.4))
+        version: 2.7.5(vue@3.5.26(typescript@5.6.3))
       hls.js:
         specifier: ^1.4.10
         version: 1.6.15
       pinia:
         specifier: ^2.0.36
-        version: 2.3.1(typescript@5.0.4)(vue@3.5.26(typescript@5.0.4))
+        version: 2.3.1(typescript@5.6.3)(vue@3.5.26(typescript@5.6.3))
       sass:
         specifier: ^1.62.1
         version: 1.97.2
       vue:
         specifier: ^3.5.13
-        version: 3.5.26(typescript@5.0.4)
+        version: 3.5.26(typescript@5.6.3)
       vue-router:
         specifier: ^4.2.0
-        version: 4.6.4(vue@3.5.26(typescript@5.0.4))
+        version: 4.6.4(vue@3.5.26(typescript@5.6.3))
     devDependencies:
       '@commitlint/cli':
         specifier: ^12.1.1
@@ -47,13 +47,13 @@ importers:
         version: 18.19.130
       '@typescript-eslint/eslint-plugin':
         specifier: ^8.20.0
-        version: 8.52.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4)
+        version: 8.52.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)
       '@typescript-eslint/parser':
         specifier: ^8.20.0
-        version: 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+        version: 8.52.0(eslint@8.57.1)(typescript@5.6.3)
       '@vitejs/plugin-vue':
         specifier: 5.0.5
-        version: 5.0.5(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4))
+        version: 5.0.5(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3))
       '@vitest/coverage-v8':
         specifier: ^4.0.16
         version: 4.0.16(vitest@4.0.16)
@@ -71,13 +71,13 @@ importers:
         version: 8.57.1
       eslint-config-airbnb-base:
         specifier: ^14.2.1
-        version: 14.2.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1))(eslint@8.57.1)
+        version: 14.2.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1)
       eslint-config-prettier:
         specifier: ^8.1.0
         version: 8.10.2(eslint@8.57.1)
       eslint-plugin-import:
         specifier: ^2.22.1
-        version: 2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)
+        version: 2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)
       eslint-plugin-prettier:
         specifier: ^3.3.1
         version: 3.4.1(eslint-config-prettier@8.10.2(eslint@8.57.1))(eslint@8.57.1)(prettier@2.8.8)
@@ -97,26 +97,26 @@ importers:
         specifier: ^2.8.8
         version: 2.8.8
       typescript:
-        specifier: ~5.0.4
-        version: 5.0.4
+        specifier: ~5.6.3
+        version: 5.6.3
       unplugin-auto-import:
         specifier: ^0.19.0
-        version: 0.19.0(@vueuse/core@9.13.0(vue@3.5.26(typescript@5.0.4)))(rollup@4.55.1)
+        version: 0.19.0(@vueuse/core@9.13.0(vue@3.5.26(typescript@5.6.3)))(rollup@4.55.1)
       unplugin-vue-components:
         specifier: ^0.28.0
-        version: 0.28.0(@babel/parser@7.28.5)(rollup@4.55.1)(vue@3.5.26(typescript@5.0.4))
+        version: 0.28.0(@babel/parser@7.28.5)(rollup@4.55.1)(vue@3.5.26(typescript@5.6.3))
       vite:
         specifier: 5.3.1
         version: 5.3.1(@types/node@18.19.130)(sass@1.97.2)
       vite-plugin-vue-devtools:
         specifier: ^7.7.0
-        version: 7.7.9(rollup@4.55.1)(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4))
+        version: 7.7.9(rollup@4.55.1)(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3))
       vitest:
         specifier: ^4.0.16
         version: 4.0.16(@types/node@18.19.130)(@vitest/ui@4.0.16)(happy-dom@20.1.0)(sass@1.97.2)
       vue-tsc:
-        specifier: 2.0.21
-        version: 2.0.21(typescript@5.0.4)
+        specifier: 2.1.10
+        version: 2.1.10(typescript@5.6.3)
 
 packages:
 
@@ -1108,14 +1108,14 @@ packages:
   '@vitest/utils@4.0.16':
     resolution: {integrity: sha512-h8z9yYhV3e1LEfaQ3zdypIrnAg/9hguReGZoS7Gl0aBG5xgA410zBqECqmaF/+RkTggRsfnzc1XaAHA6bmUufA==}
 
-  '@volar/language-core@2.3.4':
-    resolution: {integrity: sha512-wXBhY11qG6pCDAqDnbBRFIDSIwbqkWI7no+lj5+L7IlA7HRIjRP7YQLGzT0LF4lS6eHkMSsclXqy9DwYJasZTQ==}
+  '@volar/language-core@2.4.27':
+    resolution: {integrity: sha512-DjmjBWZ4tJKxfNC1F6HyYERNHPYS7L7OPFyCrestykNdUZMFYzI9WTyvwPcaNaHlrEUwESHYsfEw3isInncZxQ==}
 
-  '@volar/source-map@2.3.4':
-    resolution: {integrity: sha512-C+t63nwcblqLIVTYXaVi/+gC8NukDaDIQI72J3R7aXGvtgaVB16c+J8Iz7/VfOy7kjYv7lf5GhBny6ACw9fTGQ==}
+  '@volar/source-map@2.4.27':
+    resolution: {integrity: sha512-ynlcBReMgOZj2i6po+qVswtDUeeBRCTgDurjMGShbm8WYZgJ0PA4RmtebBJ0BCYol1qPv3GQF6jK7C9qoVc7lg==}
 
-  '@volar/typescript@2.3.4':
-    resolution: {integrity: sha512-acCvt7dZECyKcvO5geNybmrqOsu9u8n5XP1rfiYsOLYGPxvHRav9BVmEdRyZ3vvY6mNyQ1wLL5Hday4IShe17w==}
+  '@volar/typescript@2.4.27':
+    resolution: {integrity: sha512-eWaYCcl/uAPInSK2Lze6IqVWaBu/itVqR5InXcHXFyles4zO++Mglt3oxdgj75BDcv1Knr9Y93nowS8U3wqhxg==}
 
   '@vue/babel-helper-vue-transform-on@1.5.0':
     resolution: {integrity: sha512-0dAYkerNhhHutHZ34JtTl2czVQHUNWv6xEbkdF5W+Yrv5pCWsqjeORdOgbtW2I9gWlt+wBmVn+ttqN9ZxR5tzA==}
@@ -1145,6 +1145,9 @@ packages:
   '@vue/compiler-ssr@3.5.26':
     resolution: {integrity: sha512-lZT9/Y0nSIRUPVvapFJEVDbEXruZh2IYHMk2zTtEgJSlP5gVOqeWXH54xDKAaFS4rTnDeDBQUYDtxKyoW9FwDw==}
 
+  '@vue/compiler-vue2@2.7.16':
+    resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==}
+
   '@vue/devtools-api@6.6.4':
     resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==}
 
@@ -1159,8 +1162,8 @@ packages:
   '@vue/devtools-shared@7.7.9':
     resolution: {integrity: sha512-iWAb0v2WYf0QWmxCGy0seZNDPdO3Sp5+u78ORnyeonS6MT4PC7VPrryX2BpMJrwlDeaZ6BD4vP4XKjK0SZqaeA==}
 
-  '@vue/language-core@2.0.21':
-    resolution: {integrity: sha512-vjs6KwnCK++kIXT+eI63BGpJHfHNVJcUCr3RnvJsccT3vbJnZV5IhHR2puEkoOkIbDdp0Gqi1wEnv3hEd3WsxQ==}
+  '@vue/language-core@2.1.10':
+    resolution: {integrity: sha512-DAI289d0K3AB5TUG3xDp9OuQ71CnrujQwJrQnfuZDwo6eGNf0UoRlPuaVNO+Zrn65PC3j0oB2i7mNmVPggeGeQ==}
     peerDependencies:
       typescript: '*'
     peerDependenciesMeta:
@@ -1224,6 +1227,9 @@ packages:
   ajv@6.12.6:
     resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
 
+  alien-signals@0.2.2:
+    resolution: {integrity: sha512-cZIRkbERILsBOXTQmMrxc9hgpxglstn69zm+F1ARf4aPAzdAFYd6sBq87ErO0Fj3DV94tglcyHG5kQz9nDC/8A==}
+
   ansi-colors@4.1.3:
     resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
     engines: {node: '>=6'}
@@ -1437,9 +1443,6 @@ packages:
   compare-func@2.0.0:
     resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==}
 
-  computeds@0.0.1:
-    resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==}
-
   concat-map@0.0.1:
     resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
 
@@ -2520,6 +2523,9 @@ packages:
   ms@2.1.3:
     resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
 
+  muggle-string@0.4.1:
+    resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==}
+
   nanoid@3.3.11:
     resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
     engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -3178,9 +3184,9 @@ packages:
     resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
     engines: {node: '>= 0.4'}
 
-  typescript@5.0.4:
-    resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==}
-    engines: {node: '>=12.20'}
+  typescript@5.6.3:
+    resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==}
+    engines: {node: '>=14.17'}
     hasBin: true
 
   ufo@1.6.2:
@@ -3411,14 +3417,11 @@ packages:
     peerDependencies:
       vue: ^3.5.0
 
-  vue-template-compiler@2.7.16:
-    resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==}
-
-  vue-tsc@2.0.21:
-    resolution: {integrity: sha512-E6x1p1HaHES6Doy8pqtm7kQern79zRtIewkf9fiv7Y43Zo4AFDS5hKi+iHi2RwEhqRmuiwliB1LCEFEGwvxQnw==}
+  vue-tsc@2.1.10:
+    resolution: {integrity: sha512-RBNSfaaRHcN5uqVqJSZh++Gy/YUzryuv9u1aFWhsammDJXNtUiJMNoJ747lZcQ68wUQFx6E73y4FY3D8E7FGMA==}
     hasBin: true
     peerDependencies:
-      typescript: '*'
+      typescript: '>=5.0.0'
 
   vue@3.5.26:
     resolution: {integrity: sha512-SJ/NTccVyAoNUJmkM9KUqPcYlY+u8OVL1X5EW9RIs3ch5H2uERxyyIUI4MRxVCSOiEcupX9xNGde1tL9ZKpimA==}
@@ -3818,9 +3821,9 @@ snapshots:
 
   '@ctrl/tinycolor@3.6.1': {}
 
-  '@element-plus/icons-vue@2.3.2(vue@3.5.26(typescript@5.0.4))':
+  '@element-plus/icons-vue@2.3.2(vue@3.5.26(typescript@5.6.3))':
     dependencies:
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
 
   '@esbuild/aix-ppc64@0.21.5':
     optional: true
@@ -4259,40 +4262,40 @@ snapshots:
     dependencies:
       '@types/node': 18.19.130
 
-  '@typescript-eslint/eslint-plugin@8.52.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4)':
+  '@typescript-eslint/eslint-plugin@8.52.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)':
     dependencies:
       '@eslint-community/regexpp': 4.12.2
-      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
       '@typescript-eslint/scope-manager': 8.52.0
-      '@typescript-eslint/type-utils': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
-      '@typescript-eslint/utils': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+      '@typescript-eslint/type-utils': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
+      '@typescript-eslint/utils': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
       '@typescript-eslint/visitor-keys': 8.52.0
       eslint: 8.57.1
       ignore: 7.0.5
       natural-compare: 1.4.0
-      ts-api-utils: 2.4.0(typescript@5.0.4)
-      typescript: 5.0.4
+      ts-api-utils: 2.4.0(typescript@5.6.3)
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4)':
+  '@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3)':
     dependencies:
       '@typescript-eslint/scope-manager': 8.52.0
       '@typescript-eslint/types': 8.52.0
-      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.0.4)
+      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.6.3)
       '@typescript-eslint/visitor-keys': 8.52.0
       debug: 4.4.3
       eslint: 8.57.1
-      typescript: 5.0.4
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/project-service@8.52.0(typescript@5.0.4)':
+  '@typescript-eslint/project-service@8.52.0(typescript@5.6.3)':
     dependencies:
-      '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.0.4)
+      '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.6.3)
       '@typescript-eslint/types': 8.52.0
       debug: 4.4.3
-      typescript: 5.0.4
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
@@ -4301,47 +4304,47 @@ snapshots:
       '@typescript-eslint/types': 8.52.0
       '@typescript-eslint/visitor-keys': 8.52.0
 
-  '@typescript-eslint/tsconfig-utils@8.52.0(typescript@5.0.4)':
+  '@typescript-eslint/tsconfig-utils@8.52.0(typescript@5.6.3)':
     dependencies:
-      typescript: 5.0.4
+      typescript: 5.6.3
 
-  '@typescript-eslint/type-utils@8.52.0(eslint@8.57.1)(typescript@5.0.4)':
+  '@typescript-eslint/type-utils@8.52.0(eslint@8.57.1)(typescript@5.6.3)':
     dependencies:
       '@typescript-eslint/types': 8.52.0
-      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.0.4)
-      '@typescript-eslint/utils': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.6.3)
+      '@typescript-eslint/utils': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
       debug: 4.4.3
       eslint: 8.57.1
-      ts-api-utils: 2.4.0(typescript@5.0.4)
-      typescript: 5.0.4
+      ts-api-utils: 2.4.0(typescript@5.6.3)
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
   '@typescript-eslint/types@8.52.0': {}
 
-  '@typescript-eslint/typescript-estree@8.52.0(typescript@5.0.4)':
+  '@typescript-eslint/typescript-estree@8.52.0(typescript@5.6.3)':
     dependencies:
-      '@typescript-eslint/project-service': 8.52.0(typescript@5.0.4)
-      '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.0.4)
+      '@typescript-eslint/project-service': 8.52.0(typescript@5.6.3)
+      '@typescript-eslint/tsconfig-utils': 8.52.0(typescript@5.6.3)
       '@typescript-eslint/types': 8.52.0
       '@typescript-eslint/visitor-keys': 8.52.0
       debug: 4.4.3
       minimatch: 9.0.5
       semver: 7.7.3
       tinyglobby: 0.2.15
-      ts-api-utils: 2.4.0(typescript@5.0.4)
-      typescript: 5.0.4
+      ts-api-utils: 2.4.0(typescript@5.6.3)
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/utils@8.52.0(eslint@8.57.1)(typescript@5.0.4)':
+  '@typescript-eslint/utils@8.52.0(eslint@8.57.1)(typescript@5.6.3)':
     dependencies:
       '@eslint-community/eslint-utils': 4.9.1(eslint@8.57.1)
       '@typescript-eslint/scope-manager': 8.52.0
       '@typescript-eslint/types': 8.52.0
-      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.0.4)
+      '@typescript-eslint/typescript-estree': 8.52.0(typescript@5.6.3)
       eslint: 8.57.1
-      typescript: 5.0.4
+      typescript: 5.6.3
     transitivePeerDependencies:
       - supports-color
 
@@ -4352,10 +4355,10 @@ snapshots:
 
   '@ungap/structured-clone@1.3.0': {}
 
-  '@vitejs/plugin-vue@5.0.5(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4))':
+  '@vitejs/plugin-vue@5.0.5(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3))':
     dependencies:
       vite: 5.3.1(@types/node@18.19.130)(sass@1.97.2)
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
 
   '@vitest/coverage-v8@4.0.16(vitest@4.0.16)':
     dependencies:
@@ -4424,15 +4427,15 @@ snapshots:
       '@vitest/pretty-format': 4.0.16
       tinyrainbow: 3.0.3
 
-  '@volar/language-core@2.3.4':
+  '@volar/language-core@2.4.27':
     dependencies:
-      '@volar/source-map': 2.3.4
+      '@volar/source-map': 2.4.27
 
-  '@volar/source-map@2.3.4': {}
+  '@volar/source-map@2.4.27': {}
 
-  '@volar/typescript@2.3.4':
+  '@volar/typescript@2.4.27':
     dependencies:
-      '@volar/language-core': 2.3.4
+      '@volar/language-core': 2.4.27
       path-browserify: 1.0.1
       vscode-uri: 3.1.0
 
@@ -4495,9 +4498,14 @@ snapshots:
       '@vue/compiler-dom': 3.5.26
       '@vue/shared': 3.5.26
 
+  '@vue/compiler-vue2@2.7.16':
+    dependencies:
+      de-indent: 1.0.2
+      he: 1.2.0
+
   '@vue/devtools-api@6.6.4': {}
 
-  '@vue/devtools-core@7.7.9(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4))':
+  '@vue/devtools-core@7.7.9(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3))':
     dependencies:
       '@vue/devtools-kit': 7.7.9
       '@vue/devtools-shared': 7.7.9
@@ -4505,7 +4513,7 @@ snapshots:
       nanoid: 5.1.6
       pathe: 2.0.3
       vite-hot-client: 2.1.0(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
     transitivePeerDependencies:
       - vite
 
@@ -4523,17 +4531,18 @@ snapshots:
     dependencies:
       rfdc: 1.4.1
 
-  '@vue/language-core@2.0.21(typescript@5.0.4)':
+  '@vue/language-core@2.1.10(typescript@5.6.3)':
     dependencies:
-      '@volar/language-core': 2.3.4
+      '@volar/language-core': 2.4.27
       '@vue/compiler-dom': 3.5.26
+      '@vue/compiler-vue2': 2.7.16
       '@vue/shared': 3.5.26
-      computeds: 0.0.1
+      alien-signals: 0.2.2
       minimatch: 9.0.5
+      muggle-string: 0.4.1
       path-browserify: 1.0.1
-      vue-template-compiler: 2.7.16
     optionalDependencies:
-      typescript: 5.0.4
+      typescript: 5.6.3
 
   '@vue/reactivity@3.5.26':
     dependencies:
@@ -4551,11 +4560,11 @@ snapshots:
       '@vue/shared': 3.5.26
       csstype: 3.2.3
 
-  '@vue/server-renderer@3.5.26(vue@3.5.26(typescript@5.0.4))':
+  '@vue/server-renderer@3.5.26(vue@3.5.26(typescript@5.6.3))':
     dependencies:
       '@vue/compiler-ssr': 3.5.26
       '@vue/shared': 3.5.26
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
 
   '@vue/shared@3.5.26': {}
 
@@ -4566,21 +4575,21 @@ snapshots:
 
   '@vue/tsconfig@0.4.0': {}
 
-  '@vueuse/core@9.13.0(vue@3.5.26(typescript@5.0.4))':
+  '@vueuse/core@9.13.0(vue@3.5.26(typescript@5.6.3))':
     dependencies:
       '@types/web-bluetooth': 0.0.16
       '@vueuse/metadata': 9.13.0
-      '@vueuse/shared': 9.13.0(vue@3.5.26(typescript@5.0.4))
-      vue-demi: 0.14.10(vue@3.5.26(typescript@5.0.4))
+      '@vueuse/shared': 9.13.0(vue@3.5.26(typescript@5.6.3))
+      vue-demi: 0.14.10(vue@3.5.26(typescript@5.6.3))
     transitivePeerDependencies:
       - '@vue/composition-api'
       - vue
 
   '@vueuse/metadata@9.13.0': {}
 
-  '@vueuse/shared@9.13.0(vue@3.5.26(typescript@5.0.4))':
+  '@vueuse/shared@9.13.0(vue@3.5.26(typescript@5.6.3))':
     dependencies:
-      vue-demi: 0.14.10(vue@3.5.26(typescript@5.0.4))
+      vue-demi: 0.14.10(vue@3.5.26(typescript@5.6.3))
     transitivePeerDependencies:
       - '@vue/composition-api'
       - vue
@@ -4610,6 +4619,8 @@ snapshots:
       json-schema-traverse: 0.4.1
       uri-js: 4.4.1
 
+  alien-signals@0.2.2: {}
+
   ansi-colors@4.1.3: {}
 
   ansi-escapes@4.3.2:
@@ -4842,8 +4853,6 @@ snapshots:
       array-ify: 1.0.0
       dot-prop: 5.3.0
 
-  computeds@0.0.1: {}
-
   concat-map@0.0.1: {}
 
   confbox@0.1.8: {}
@@ -4999,15 +5008,15 @@ snapshots:
 
   electron-to-chromium@1.5.267: {}
 
-  element-plus@2.7.5(vue@3.5.26(typescript@5.0.4)):
+  element-plus@2.7.5(vue@3.5.26(typescript@5.6.3)):
     dependencies:
       '@ctrl/tinycolor': 3.6.1
-      '@element-plus/icons-vue': 2.3.2(vue@3.5.26(typescript@5.0.4))
+      '@element-plus/icons-vue': 2.3.2(vue@3.5.26(typescript@5.6.3))
       '@floating-ui/dom': 1.7.4
       '@popperjs/core': '@sxzz/popperjs-es@2.11.7'
       '@types/lodash': 4.17.21
       '@types/lodash-es': 4.17.12
-      '@vueuse/core': 9.13.0(vue@3.5.26(typescript@5.0.4))
+      '@vueuse/core': 9.13.0(vue@3.5.26(typescript@5.6.3))
       async-validator: 4.2.5
       dayjs: 1.11.19
       escape-html: 1.0.3
@@ -5016,7 +5025,7 @@ snapshots:
       lodash-unified: 1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.17.22)(lodash@4.17.21)
       memoize-one: 6.0.0
       normalize-wheel-es: 1.2.0
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
     transitivePeerDependencies:
       - '@vue/composition-api'
 
@@ -5188,11 +5197,11 @@ snapshots:
 
   escape-string-regexp@5.0.0: {}
 
-  eslint-config-airbnb-base@14.2.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1))(eslint@8.57.1):
+  eslint-config-airbnb-base@14.2.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1):
     dependencies:
       confusing-browser-globals: 1.0.11
       eslint: 8.57.1
-      eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)
+      eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)
       object.assign: 4.1.7
       object.entries: 1.1.9
 
@@ -5208,17 +5217,17 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  eslint-module-utils@2.12.1(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1):
+  eslint-module-utils@2.12.1(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1):
     dependencies:
       debug: 3.2.7
     optionalDependencies:
-      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
       eslint: 8.57.1
       eslint-import-resolver-node: 0.3.9
     transitivePeerDependencies:
       - supports-color
 
-  eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1):
+  eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1):
     dependencies:
       '@rtsao/scc': 1.1.0
       array-includes: 3.1.9
@@ -5229,7 +5238,7 @@ snapshots:
       doctrine: 2.1.0
       eslint: 8.57.1
       eslint-import-resolver-node: 0.3.9
-      eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1)
+      eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.52.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1)
       hasown: 2.0.2
       is-core-module: 2.16.1
       is-glob: 4.0.3
@@ -5241,7 +5250,7 @@ snapshots:
       string.prototype.trimend: 1.0.9
       tsconfig-paths: 3.15.0
     optionalDependencies:
-      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.0.4)
+      '@typescript-eslint/parser': 8.52.0(eslint@8.57.1)(typescript@5.6.3)
     transitivePeerDependencies:
       - eslint-import-resolver-typescript
       - eslint-import-resolver-webpack
@@ -6080,6 +6089,8 @@ snapshots:
 
   ms@2.1.3: {}
 
+  muggle-string@0.4.1: {}
+
   nanoid@3.3.11: {}
 
   nanoid@5.1.6: {}
@@ -6264,13 +6275,13 @@ snapshots:
 
   picomatch@4.0.3: {}
 
-  pinia@2.3.1(typescript@5.0.4)(vue@3.5.26(typescript@5.0.4)):
+  pinia@2.3.1(typescript@5.6.3)(vue@3.5.26(typescript@5.6.3)):
     dependencies:
       '@vue/devtools-api': 6.6.4
-      vue: 3.5.26(typescript@5.0.4)
-      vue-demi: 0.14.10(vue@3.5.26(typescript@5.0.4))
+      vue: 3.5.26(typescript@5.6.3)
+      vue-demi: 0.14.10(vue@3.5.26(typescript@5.6.3))
     optionalDependencies:
-      typescript: 5.0.4
+      typescript: 5.6.3
     transitivePeerDependencies:
       - '@vue/composition-api'
 
@@ -6726,9 +6737,9 @@ snapshots:
 
   trim-newlines@3.0.1: {}
 
-  ts-api-utils@2.4.0(typescript@5.0.4):
+  ts-api-utils@2.4.0(typescript@5.6.3):
     dependencies:
-      typescript: 5.0.4
+      typescript: 5.6.3
 
   tsconfig-paths@3.15.0:
     dependencies:
@@ -6786,7 +6797,7 @@ snapshots:
       possible-typed-array-names: 1.1.0
       reflect.getprototypeof: 1.0.10
 
-  typescript@5.0.4: {}
+  typescript@5.6.3: {}
 
   ufo@1.6.2: {}
 
@@ -6824,7 +6835,7 @@ snapshots:
 
   universalify@2.0.1: {}
 
-  unplugin-auto-import@0.19.0(@vueuse/core@9.13.0(vue@3.5.26(typescript@5.0.4)))(rollup@4.55.1):
+  unplugin-auto-import@0.19.0(@vueuse/core@9.13.0(vue@3.5.26(typescript@5.6.3)))(rollup@4.55.1):
     dependencies:
       '@antfu/utils': 0.7.10
       '@rollup/pluginutils': 5.3.0(rollup@4.55.1)
@@ -6834,11 +6845,11 @@ snapshots:
       unimport: 3.14.6(rollup@4.55.1)
       unplugin: 2.3.11
     optionalDependencies:
-      '@vueuse/core': 9.13.0(vue@3.5.26(typescript@5.0.4))
+      '@vueuse/core': 9.13.0(vue@3.5.26(typescript@5.6.3))
     transitivePeerDependencies:
       - rollup
 
-  unplugin-vue-components@0.28.0(@babel/parser@7.28.5)(rollup@4.55.1)(vue@3.5.26(typescript@5.0.4)):
+  unplugin-vue-components@0.28.0(@babel/parser@7.28.5)(rollup@4.55.1)(vue@3.5.26(typescript@5.6.3)):
     dependencies:
       '@antfu/utils': 0.7.10
       '@rollup/pluginutils': 5.3.0(rollup@4.55.1)
@@ -6850,7 +6861,7 @@ snapshots:
       minimatch: 9.0.5
       mlly: 1.8.0
       unplugin: 2.3.11
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
     optionalDependencies:
       '@babel/parser': 7.28.5
     transitivePeerDependencies:
@@ -6906,9 +6917,9 @@ snapshots:
       - rollup
       - supports-color
 
-  vite-plugin-vue-devtools@7.7.9(rollup@4.55.1)(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4)):
+  vite-plugin-vue-devtools@7.7.9(rollup@4.55.1)(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3)):
     dependencies:
-      '@vue/devtools-core': 7.7.9(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.0.4))
+      '@vue/devtools-core': 7.7.9(vite@5.3.1(@types/node@18.19.130)(sass@1.97.2))(vue@3.5.26(typescript@5.6.3))
       '@vue/devtools-kit': 7.7.9
       '@vue/devtools-shared': 7.7.9
       execa: 9.6.1
@@ -7003,9 +7014,9 @@ snapshots:
 
   vue-component-type-helpers@2.2.12: {}
 
-  vue-demi@0.14.10(vue@3.5.26(typescript@5.0.4)):
+  vue-demi@0.14.10(vue@3.5.26(typescript@5.6.3)):
     dependencies:
-      vue: 3.5.26(typescript@5.0.4)
+      vue: 3.5.26(typescript@5.6.3)
 
   vue-eslint-parser@9.4.3(eslint@8.57.1):
     dependencies:
@@ -7020,32 +7031,27 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  vue-router@4.6.4(vue@3.5.26(typescript@5.0.4)):
+  vue-router@4.6.4(vue@3.5.26(typescript@5.6.3)):
     dependencies:
       '@vue/devtools-api': 6.6.4
-      vue: 3.5.26(typescript@5.0.4)
-
-  vue-template-compiler@2.7.16:
-    dependencies:
-      de-indent: 1.0.2
-      he: 1.2.0
+      vue: 3.5.26(typescript@5.6.3)
 
-  vue-tsc@2.0.21(typescript@5.0.4):
+  vue-tsc@2.1.10(typescript@5.6.3):
     dependencies:
-      '@volar/typescript': 2.3.4
-      '@vue/language-core': 2.0.21(typescript@5.0.4)
+      '@volar/typescript': 2.4.27
+      '@vue/language-core': 2.1.10(typescript@5.6.3)
       semver: 7.7.3
-      typescript: 5.0.4
+      typescript: 5.6.3
 
-  vue@3.5.26(typescript@5.0.4):
+  vue@3.5.26(typescript@5.6.3):
     dependencies:
       '@vue/compiler-dom': 3.5.26
       '@vue/compiler-sfc': 3.5.26
       '@vue/runtime-dom': 3.5.26
-      '@vue/server-renderer': 3.5.26(vue@3.5.26(typescript@5.0.4))
+      '@vue/server-renderer': 3.5.26(vue@3.5.26(typescript@5.6.3))
       '@vue/shared': 3.5.26
     optionalDependencies:
-      typescript: 5.0.4
+      typescript: 5.6.3
 
   webpack-virtual-modules@0.6.2: {}
 

+ 2 - 2
src/views/audit/index.vue

@@ -167,7 +167,7 @@ const auditList = ref<AuditLog[]>([])
 const total = ref(0)
 const detailVisible = ref(false)
 const currentLog = ref<AuditLog | null>(null)
-const dateRange = ref<[string, string] | null>(null)
+const dateRange = ref<[string, string] | undefined>(undefined)
 
 const queryParams = reactive<AuditLogQueryParams & { page: number; pageSize: number }>({
   action: '',
@@ -279,7 +279,7 @@ function resetQuery() {
   queryParams.action = ''
   queryParams.resource = ''
   queryParams.user_id = ''
-  dateRange.value = null
+  dateRange.value = undefined
   queryParams.page = 1
   getList()
 }

+ 2 - 5
tests/mocks/api.ts

@@ -77,7 +77,7 @@ export function mockMachineApi(request: MockedRequest) {
     return Promise.resolve(fixtures.wrapErrorResponse('Not Found', 404))
   })
 
-  request.post.mockImplementation((url: string, data?: any, config?: any) => {
+  request.post.mockImplementation((url: string, data?: any, _config?: any) => {
     if (url === '/admin/machines/add') {
       const newMachine: typeof fixtures.mockMachines[0] = {
         id: fixtures.mockMachines.length + 1,
@@ -100,7 +100,7 @@ export function mockMachineApi(request: MockedRequest) {
       return Promise.resolve(fixtures.wrapErrorResponse('机器不存在', 404))
     }
     if (url === '/admin/machines/delete') {
-      const id = config?.params?.id
+      const id = _config?.params?.id
       const machine = fixtures.mockMachines.find((m) => m.id === id)
       if (machine) {
         if (machine.cameraCount > 0) {
@@ -207,9 +207,6 @@ export function mockStatsApi(request: MockedRequest) {
  * 设置所有 API mock
  */
 export function mockAllApis(request: MockedRequest) {
-  const originalGet = request.get.getMockImplementation?.() || (() => {})
-  const originalPost = request.post.getMockImplementation?.() || (() => {})
-
   request.get.mockImplementation((url: string, params?: any) => {
     // Auth
     if (url === '/admin/auth/info') {

+ 35 - 62
tests/unit/api/camera.spec.ts

@@ -14,6 +14,7 @@ import {
   adminCheckCamera
 } from '@/api/camera'
 import * as request from '@/utils/request'
+import { mockCameras, mockChannels, wrapResponse } from '../../fixtures'
 
 vi.mock('@/utils/request', () => ({
   get: vi.fn(),
@@ -28,30 +29,17 @@ describe('Camera API', () => {
   describe('Controller APIs', () => {
     describe('listCameras', () => {
       it('should call GET /camera/list', async () => {
-        const mockResponse = {
-          code: 200,
-          data: [
-            {
-              cameraId: 'cam-001',
-              name: '摄像头1',
-              machineId: 'machine-001',
-              status: 'ONLINE',
-              capability: 'ptz_enabled',
-              ptzSupported: true,
-              channels: []
-            }
-          ]
-        }
+        const mockResponse = wrapResponse(mockCameras)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
         const result = await listCameras()
 
         expect(request.get).toHaveBeenCalledWith('/camera/list', undefined)
-        expect(result.data).toHaveLength(1)
+        expect(result.data).toHaveLength(mockCameras.length)
       })
 
       it('should call with machineId filter', async () => {
-        vi.mocked(request.get).mockResolvedValue({ code: 200, data: [] })
+        vi.mocked(request.get).mockResolvedValue(wrapResponse([]))
 
         await listCameras('machine-001')
 
@@ -61,55 +49,49 @@ describe('Camera API', () => {
 
     describe('getCamera', () => {
       it('should call GET /camera/:id', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { cameraId: 'cam-001', name: '摄像头1' }
-        }
+        const camera = mockCameras[0]
+        const mockResponse = wrapResponse(camera)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
-        const result = await getCamera('cam-001')
+        const result = await getCamera(camera.cameraId)
 
-        expect(request.get).toHaveBeenCalledWith('/camera/cam-001')
-        expect(result.data.cameraId).toBe('cam-001')
+        expect(request.get).toHaveBeenCalledWith(`/camera/${camera.cameraId}`)
+        expect(result.data.cameraId).toBe(camera.cameraId)
       })
     })
 
     describe('switchChannel', () => {
       it('should call POST /camera/switch', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { channelId: 'ch-001', name: '通道1' }
-        }
+        const channel = mockChannels[0]
+        const mockResponse = wrapResponse(channel)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
-        const result = await switchChannel({ machineId: 'machine-001', channelId: 'ch-001' })
+        const result = await switchChannel({ machineId: 'machine-001', channelId: channel.channelId })
 
         expect(request.post).toHaveBeenCalledWith('/camera/switch', {
           machineId: 'machine-001',
-          channelId: 'ch-001'
+          channelId: channel.channelId
         })
-        expect(result.data.channelId).toBe('ch-001')
+        expect(result.data.channelId).toBe(channel.channelId)
       })
     })
 
     describe('getCurrentChannel', () => {
       it('should call GET /camera/current', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { channelId: 'ch-001', name: '当前通道' }
-        }
+        const channel = mockChannels[0]
+        const mockResponse = wrapResponse(channel)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
         const result = await getCurrentChannel('machine-001')
 
         expect(request.get).toHaveBeenCalledWith('/camera/current', { machineId: 'machine-001' })
-        expect(result.data.channelId).toBe('ch-001')
+        expect(result.data.channelId).toBe(channel.channelId)
       })
     })
 
     describe('ptzStart', () => {
       it('should call POST /camera/:id/ptz/start', async () => {
-        const mockResponse = { code: 200, data: null }
+        const mockResponse = wrapResponse(null)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         await ptzStart('cam-001', 'up', 50)
@@ -122,7 +104,7 @@ describe('Camera API', () => {
 
     describe('ptzStop', () => {
       it('should call POST /camera/:id/ptz/stop', async () => {
-        const mockResponse = { code: 200, data: null }
+        const mockResponse = wrapResponse(null)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         await ptzStop('cam-001')
@@ -135,44 +117,37 @@ describe('Camera API', () => {
   describe('Admin APIs', () => {
     describe('adminListCameras', () => {
       it('should call GET /admin/cameras/list', async () => {
-        const mockResponse = {
-          code: 200,
-          data: [{ id: 1, cameraId: 'cam-001', name: '摄像头1' }]
-        }
+        const mockResponse = wrapResponse(mockCameras)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
         const result = await adminListCameras()
 
         expect(request.get).toHaveBeenCalledWith('/admin/cameras/list', undefined)
-        expect(result.data).toHaveLength(1)
+        expect(result.data).toHaveLength(mockCameras.length)
       })
     })
 
     describe('adminGetCamera', () => {
       it('should call GET /admin/cameras/detail', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { id: 1, cameraId: 'cam-001' }
-        }
+        const camera = mockCameras[0]
+        const mockResponse = wrapResponse(camera)
         vi.mocked(request.get).mockResolvedValue(mockResponse)
 
-        const result = await adminGetCamera(1)
+        const result = await adminGetCamera(camera.id)
 
-        expect(request.get).toHaveBeenCalledWith('/admin/cameras/detail', { id: 1 })
-        expect(result.data.id).toBe(1)
+        expect(request.get).toHaveBeenCalledWith('/admin/cameras/detail', { id: camera.id })
+        expect(result.data.id).toBe(camera.id)
       })
     })
 
     describe('adminAddCamera', () => {
       it('should call POST /admin/cameras/add', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { id: 1, cameraId: 'cam-002', name: '新摄像头' }
-        }
+        const newCamera = { ...mockCameras[0], id: 100, cameraId: 'cam-new' }
+        const mockResponse = wrapResponse(newCamera)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         const addData = {
-          cameraId: 'cam-002',
+          cameraId: 'cam-new',
           name: '新摄像头',
           ip: '192.168.1.100',
           port: 80
@@ -180,19 +155,17 @@ describe('Camera API', () => {
         const result = await adminAddCamera(addData)
 
         expect(request.post).toHaveBeenCalledWith('/admin/cameras/add', addData)
-        expect(result.data.cameraId).toBe('cam-002')
+        expect(result.data.cameraId).toBe('cam-new')
       })
     })
 
     describe('adminUpdateCamera', () => {
       it('should call POST /admin/cameras/update', async () => {
-        const mockResponse = {
-          code: 200,
-          data: { id: 1, name: '更新后名称' }
-        }
+        const updatedCamera = { ...mockCameras[0], name: '更新后名称' }
+        const mockResponse = wrapResponse(updatedCamera)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
-        const updateData = { id: 1, name: '更新后名称' }
+        const updateData = { id: mockCameras[0].id, name: '更新后名称' }
         const result = await adminUpdateCamera(updateData)
 
         expect(request.post).toHaveBeenCalledWith('/admin/cameras/update', updateData)
@@ -202,7 +175,7 @@ describe('Camera API', () => {
 
     describe('adminDeleteCamera', () => {
       it('should call POST /admin/cameras/delete', async () => {
-        const mockResponse = { code: 200, data: null }
+        const mockResponse = wrapResponse(null)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         await adminDeleteCamera(1)
@@ -215,7 +188,7 @@ describe('Camera API', () => {
 
     describe('adminCheckCamera', () => {
       it('should call POST /admin/cameras/check', async () => {
-        const mockResponse = { code: 200, data: true }
+        const mockResponse = wrapResponse(true)
         vi.mocked(request.post).mockResolvedValue(mockResponse)
 
         const result = await adminCheckCamera(1)

+ 1 - 1
tests/unit/store/user.spec.ts

@@ -42,7 +42,7 @@ describe('User Store', () => {
     })
 
     it('should not store token on login failure', async () => {
-      const mockResponse = wrapErrorResponse('用户名或密码错误', 401)
+      const mockResponse = wrapErrorResponse('用户名或密码错误', 401) as any
       vi.mocked(loginApi.login).mockResolvedValue(mockResponse)
 
       const store = useUserStore()

+ 4 - 2
tsconfig.test.json

@@ -1,7 +1,9 @@
 {
   "extends": "./tsconfig.app.json",
   "compilerOptions": {
-    "types": ["vitest/globals", "node"]
+    "types": ["vitest/globals", "node", "vite/client"],
+    "noUnusedLocals": false,
+    "noUnusedParameters": false
   },
-  "include": ["tests/**/*"]
+  "include": ["tests/**/*", "src/**/*.ts", "src/**/*.vue"]
 }