|
@@ -9,6 +9,8 @@ import { Task, Track, SpecialTag, Question } from '@/api/types/task';
|
|
|
import { TrackConfigType } from '@/store/modules/app/types';
|
|
|
import { PictureTypeEnum } from '@/constants/enumerate';
|
|
|
import { calcSum, maxNum, strGbLen } from '@/utils/utils';
|
|
|
+import { useAppStore } from '@/store';
|
|
|
+
|
|
|
import { DrawTrackItem } from '../../../../electron/preload/types';
|
|
|
import { TrackTaskData } from '../../../../electron/db/models/trackTask';
|
|
|
|
|
@@ -107,6 +109,7 @@ export default function useDraw(winId: number) {
|
|
|
let curStudentId = '';
|
|
|
const task = ref({} as TrackTaskData);
|
|
|
const trackConfig = ref({} as TrackConfigType);
|
|
|
+ const appStore = useAppStore();
|
|
|
|
|
|
function addLog(content: string, type?: 'info' | 'error') {
|
|
|
window.api.logger(`win:${curWinId} ${content}`, type);
|
|
@@ -234,8 +237,12 @@ export default function useDraw(winId: number) {
|
|
|
async function downloadImages(urls: string[]) {
|
|
|
const downloads: Promise<ImageItem>[] = [];
|
|
|
for (let i = 0; i < urls.length; i++) {
|
|
|
+ let url = urls[i];
|
|
|
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
|
+ url = `${appStore.domain}/${url}`;
|
|
|
+ }
|
|
|
downloads.push(
|
|
|
- window.api.downloadImage(urls[i], getOutputPath('origin', i + 1))
|
|
|
+ window.api.downloadImage(url, getOutputPath('origin', i + 1))
|
|
|
);
|
|
|
}
|
|
|
|