Ver código fonte

chore(api): 适配“获取资源”接口

ccnnde 2 meses atrás
pai
commit
2183118233
3 arquivos alterados com 3 adições e 2 exclusões
  1. 1 0
      src/env.d.ts
  2. 1 1
      src/services/png.ts
  3. 1 1
      src/views/components/Graphics.vue

+ 1 - 0
src/env.d.ts

@@ -9,6 +9,7 @@ declare module '*.vue' {
 
 interface ImportMetaEnv {
   readonly VITE_BASE_API: string;
+  readonly VITE_IMG_API: string;
   readonly VITE_TEMP_TOKEN: string;
 }
 

+ 1 - 1
src/services/png.ts

@@ -34,7 +34,7 @@ export async function getFolders(name: string, isSvg?: boolean) {
           }
           const elem: any = {
             name,
-            image: cdn + '/' + f,
+            image: import.meta.env.VITE_IMG_API + '/' + f,
             isSvg,
           };
           list.push(elem);

+ 1 - 1
src/views/components/Graphics.vue

@@ -743,7 +743,7 @@ const groupChange = async (name: string) => {
       groupType.value = 1;
       if (!materials.length) {
         loading.value = true;
-        materials.push(...(await getFolders('v/material')));
+        materials.push(...(await getFolders('material')));
         loading.value = false;
         const _materials: string = await localforage.getItem(
           'le5leV-materials'