From 101c95d78f140292309876ade453696c95fbef7b Mon Sep 17 00:00:00 2001 From: mengyxu Date: Fri, 25 Apr 2025 15:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/action.ts | 2 +- src/tool/assets.ts | 24 ------------------------ src/tool/index.ts | 1 - 3 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 src/tool/assets.ts diff --git a/src/store/action.ts b/src/store/action.ts index 36ef716..d12e983 100644 --- a/src/store/action.ts +++ b/src/store/action.ts @@ -1,5 +1,5 @@ import { initialWeapon, initialArmor, initialNeck, initialRing, i18n, archive_name } from '@/config'; -import { conisOfsell, getAssets } from '@/tool'; +import { conisOfsell } from '@/tool'; import { Base64 } from 'js-base64'; const backgound = new Audio('/audio/backgound.mp3'); diff --git a/src/tool/assets.ts b/src/tool/assets.ts deleted file mode 100644 index 36a5109..0000000 --- a/src/tool/assets.ts +++ /dev/null @@ -1,24 +0,0 @@ -const data: any = {}; -export const getAssets = (url) => { - return new Promise((resolve, reject) => { - if (data[url]) { - resolve(data[url]); - } else { - const xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'blob'; - xhr.onload = function () { - const blob = xhr.response; - const file = new File([blob!], url, { type: blob!.type }); - console.log(file); - data[url] = URL.createObjectURL(file); - console.log(data[url]); - resolve(data[url]); - // } else { - // resolve(null); - // } - }; - xhr.send(); - } - }); -}; diff --git a/src/tool/index.ts b/src/tool/index.ts index 00e52a7..5808013 100644 --- a/src/tool/index.ts +++ b/src/tool/index.ts @@ -2,7 +2,6 @@ export * from './caller'; export * from './formatter'; export * from './random'; export * from './mixins'; -export * from './assets'; export const getArrayEmptyIdx = (array) => { for (let i = 0; i < array.length; i++) {