apply Network.ts

This commit is contained in:
Timi
2025-12-17 16:56:33 +08:00
parent 369cfe2bf2
commit 62186abdb8
13 changed files with 584 additions and 696 deletions

View File

@ -1,7 +1,7 @@
// components/travel-location-popup/index.ts
import { TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon } from "../../types/Travel";
import { TravelLocationApi } from "../../api/TravelLocationApi";
import { MediaAttachExt, MediaAttachType } from "../../types/Attachment";
import { ImageMetadata, MediaAttachType } from "../../types/Attachment";
import { MediaItem, MediaItemType } from "../../types/UI";
import config from "../../config/index";
import Toolkit from "../../utils/Toolkit";
@ -39,11 +39,11 @@ Component({
// 处理附件数据
const attachments = location.items || [];
const thumbItems = attachments.filter((item: any) => item.attachType === MediaAttachType.THUMB);
const thumbItems = attachments.filter(item => item.attachType === MediaAttachType.THUMB);
if (0 < thumbItems.length) {
const mediaItems: MediaItem[] = thumbItems.map((thumbItem: any, index: number) => {
const metadata = thumbItem.metadata;
const mediaItems: MediaItem[] = thumbItems.map((thumbItem, index) => {
const metadata = thumbItem.metadata as ImageMetadata;
const ext = typeof thumbItem.ext === "string" ? JSON.parse(thumbItem.ext) : thumbItem.ext;
const thumbURL = `${config.url}/attachment/read/${thumbItem.mongoId}`;
const sourceURL = `${config.url}/attachment/read/${ext.sourceMongoId}`;