fix: 修复多个外设无法认证的问题

refactor: 同时使用更加优雅的方式处理injection
This commit is contained in:
2025-07-15 11:30:09 +08:00
parent 705e322e41
commit 49cbdc51d9
6 changed files with 184 additions and 84 deletions

View File

@@ -48,14 +48,15 @@
import { computed } from "vue";
import { CheckCircle, XCircle, AlertTriangle, Info, X } from "lucide-vue-next";
import { useAlertStore } from ".";
import { useRequiredInjection } from "@/utils/Common";
const alertStore = useAlertStore();
const alertStore = useRequiredInjection(useAlertStore);
// Computed classes for different alert types
const alertClasses = computed(() => {
const baseClasses = "shadow-lg max-w-sm";
switch (alertStore?.alertState.value.type) {
switch (alertStore.alertState.value.type) {
case "success":
return `${baseClasses} alert-success`;
case "error":