fix: share token

This commit is contained in:
zzc
2026-02-05 23:43:51 +08:00
parent 3f764693c1
commit d76269b154
8 changed files with 79 additions and 96 deletions

View File

@@ -54,7 +54,7 @@ export const saveRecordRequest = async (path, targetId, scene, imageUrl) => {
});
};
export const saveViewRequest = async (shareToken, scene, targetId) => {
export const saveViewRequest = async (shareToken, scene, targetId = "") => {
const deviceInfo = getDeviceInfo();
viewRecord({
shareToken,
@@ -92,7 +92,12 @@ export const saveRemoteImageToLocal = (imageUrl) => {
});
};
export const getShareToken = async (scene, targetId) => {
export const getShareToken = async (scene, targetId = "") => {
const deviceInfo = getDeviceInfo();
return await createShareToken({ scene, targetId, ...deviceInfo });
const shareTokenRes = await createShareToken({
scene,
targetId,
...deviceInfo,
});
return shareTokenRes?.shareToken || "";
};