From a08108139526214a36aba424de99ab2a50825798 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 21 六月 2024 18:30:25 +0800 Subject: [PATCH] 数学资源收藏 --- src/assets/methods/resources.js | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/src/assets/methods/resources.js b/src/assets/methods/resources.js index bd860ff..74e4315 100644 --- a/src/assets/methods/resources.js +++ b/src/assets/methods/resources.js @@ -1,4 +1,5 @@ import fileApi from "@/assets/js/middleGround/api/file"; +import identityApi from "../js/middleGround/api/identity"; export const getResourcePath = async (md5, appRefCode = "jingshieke") => { let path = ""; await fileApi @@ -15,8 +16,36 @@ }); return path; }; +// 鑾峰彇鏀惰棌鐨勮祫婧� +export const getCollectResource = async (key) => { + 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