🐛 fixed the logic of judging screenshots

This commit is contained in:
2025-01-23 19:15:36 +08:00
parent 0255e6b75e
commit a2e80b9a91
3 changed files with 54 additions and 46 deletions

View File

@@ -2,11 +2,11 @@ import localforage from 'localforage';
interface UploadPredictResult {
isAnime: boolean;
hasFace: boolean;
objectArray: string[] | unknown[];
landscape: 'building' | 'forest' | 'glacier' | 'mountain' | 'sea' | 'street' | 'none';
isScreenshot: boolean;
topCategory: string | undefined;
exif: object | null;
}
@@ -15,14 +15,13 @@ export const useUploadStore = defineStore(
() => {
const openUploadDrawer = ref<boolean>(false);
const exifData = ref<any>();
const predictResult = reactive<UploadPredictResult>({
isAnime: false,
hasFace: false,
objectArray: [],
landscape: 'none',
isScreenshot: false,
topCategory: ''
topCategory: '',
exif: {}
});
/**
@@ -37,18 +36,17 @@ export const useUploadStore = defineStore(
*/
function clearPredictResult() {
predictResult.isAnime = false;
predictResult.hasFace = false;
predictResult.objectArray = [];
predictResult.landscape = 'none';
predictResult.isScreenshot = false;
predictResult.topCategory = '';
predictResult.exif = {};
}
return {
openUploadDrawer,
predictResult,
exifData,
openUploadDrawerFn,
clearPredictResult,
};