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

@@ -1,9 +1,9 @@
import { ref } from "vue";
import { createInjectionState } from "@vueuse/core";
import { RemoteUpdateClient, DataClient, Board } from "@/APIClient";
import { Common } from "@/utils/Common";
import { isUndefined } from "lodash";
import { AuthManager } from "@/utils/AuthManager";
import { toFileParameterOrNull } from "./Common";
// 统一的板卡数据接口扩展原有的Board类型
export interface BoardData extends Board {
@@ -178,10 +178,10 @@ const [useProvideBoardManager, useBoardManager] = createInjectionState(() => {
const uploadResult = await remoteUpdater.uploadBitstreams(
board.ipAddr,
Common.toFileParameterOrNull(goldBitstream),
Common.toFileParameterOrNull(appBitstream1),
Common.toFileParameterOrNull(appBitstream2),
Common.toFileParameterOrNull(appBitstream3),
toFileParameterOrNull(goldBitstream),
toFileParameterOrNull(appBitstream1),
toFileParameterOrNull(appBitstream2),
toFileParameterOrNull(appBitstream3),
);
if (!uploadResult) {