From 056a77b919396c2a30abb6b682a8fd683f18467a Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期一, 20 一月 2025 19:09:37 +0800
Subject: [PATCH] 幼儿园语言

---
 src/assets/methods/resources.js |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/src/assets/methods/resources.js b/src/assets/methods/resources.js
index bd860ff..f98cbb3 100644
--- a/src/assets/methods/resources.js
+++ b/src/assets/methods/resources.js
@@ -1,4 +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
@@ -7,7 +9,7 @@
       appRefCode,
     })
     .then((res) => {
-      if (res?.data != "" && res?.data != undefined) {
+      if (res.data != "" && res.data != undefined) {
         path = res.data;
       } else {
         path = process.env.VUE_APP_API_URL + "/file/api/ApiDownload?md5=" + md5;
@@ -15,8 +17,37 @@
     });
   return path;
 };
+// 鑾峰彇鏀惰棌鐨勮祫婧�
+export const getCollectResource = async (key) => {
+  if(!localStorage.getItem(tokenKey)) return []
+  let list = []
+  await identityApi
+  .getUserKey({
+    domain: "collectResource",
+    keys: [key],
+  })
+  .then((res) => {
+    if(res.length) {
+      list = JSON.parse(res[0].value)
+    }
+  });
+  return list
+}
+export const setCollectResource = (key,list) => {
+  identityApi.setUserKey({
+    setKeyRequests: [
+      {
+        domain: "collectResource",
+        key,
+        value: JSON.stringify(list),
+      },
+    ],
+  })
+}
 const MT = {
   getResourcePath,
+  getCollectResource,
+  setCollectResource
 };
 
 export default MT;

--
Gitblit v1.9.1