设置云触手默认登录设备

This commit is contained in:
yml
2026-05-28 13:05:44 +08:00
parent e4c9873c8d
commit e8ba48d74f
22 changed files with 198 additions and 79 deletions
@@ -1,4 +1,8 @@
import { createHttpError } from "../../../utils/http.js";
import {
normalizeCloudtentaclesDeviceId,
normalizeCloudtentaclesDeviceType,
} from "../../platforms/cloudtentacles/defaults.js";
import { getCloudtentaclesSourceByKey } from "../../platforms/cloudtentacles/source-config-service.js";
import { getCloudtentaclesSessionStateByKey } from "../../platforms/cloudtentacles/session-state-service.js";
import { normalizeStringArray } from "./domain.js";
@@ -53,9 +57,12 @@ export function resolvePersistedCloudtentaclesContextBySourceKeys(
String(session.baseUrl || source.baseUrl || "").trim() ||
"https://123.207.217.176",
token,
deviceId:
String(session.deviceId || source.deviceId || "-").trim() || "-",
deviceType: Number(session.deviceType ?? source.deviceType ?? 0),
deviceId: normalizeCloudtentaclesDeviceId(
session.deviceId || source.deviceId
),
deviceType: normalizeCloudtentaclesDeviceType(
session.deviceType ?? source.deviceType
),
resolvedSourceKey: sourceKey,
};
}