diff --git a/src/services/map-converter.service.ts b/src/services/map-converter.service.ts index 68058bf..20f32d9 100644 --- a/src/services/map-converter.service.ts +++ b/src/services/map-converter.service.ts @@ -1,4 +1,5 @@ import axios from 'axios'; + import { decodeTextFile } from './utils'; export type ProcessJsonListItem = { @@ -22,8 +23,8 @@ export async function collectOriginalProperties( const currentScenesArray: any[] = Array.isArray(currentFloorScenes) ? currentFloorScenes : currentFloorScenes - ? [currentFloorScenes] - : []; + ? [currentFloorScenes] + : []; const list = await Promise.all( floorImportList.map(async (_floor, idx) => { @@ -65,7 +66,11 @@ export async function buildProcessJsonListPayload( const content = await decodeTextFile(file); if (!content) throw new Error(`楼层 ${floor.name} 的文件 ${file?.name} 读取为空`); placeholders.push(content); - const ext = String(file?.name || '').toLowerCase().split('.').pop() || ''; + const ext = + String(file?.name || '') + .toLowerCase() + .split('.') + .pop() || ''; exts.push(ext); } @@ -109,7 +114,7 @@ export async function buildProcessJsonListPayload( export async function postProcessJsonList(payload: ProcessJsonListItem[]): Promise { const client = axios.create(); - const url = '/api/map-converter/process-json-list'; + const url = '/vwedApi/api/map-converter/process-json-list'; const response = await client.post(url, payload, { responseType: 'blob' }); const contentType = (response.headers?.['content-type'] || '').toString().toLowerCase();