litian
2025-01-24 d539ff4e3376b889d212e90db1c3434f4b0de8d0
src/assets/methods/resources.js
@@ -1,5 +1,6 @@
import fileApi from "@/assets/js/middleGround/api/file";
import identityApi from "../js/middleGround/api/identity";
import { tokenKey } from "../js/config";
export const getResourcePath = async (md5, appRefCode = "jingshieke") => {
  let path = "";
  await fileApi
@@ -8,16 +9,21 @@
      appRefCode,
    })
    .then((res) => {
      if (res?.data != "" && res?.data != undefined) {
        path = res.data;
      } else {
      if (res) {
        if (res && res.data == '') {
          path = process.env.VUE_APP_API_URL + "/file/api/ApiDownload?md5=" + md5;
        } else {
          path = res;
        }
      } else if (md5) {
        path = process.env.VUE_APP_API_URL + "/file/api/ApiDownload?md5=" + md5;
      }
      }
    });
  return path;
};
// 获取收藏的资源
export const getCollectResource = async (key) => {
  if(!localStorage.getItem(tokenKey)) return []
  let list = []
  await identityApi
  .getUserKey({