Commit 78e9eb81 authored by 李超鹏's avatar 李超鹏

添加图片更新缓存接口

parent a150813d
......@@ -39,6 +39,8 @@ const db = uniCloud.database({
/* 清空用户之前的图片 {"token":""} */
let cleanImage = async (params = {}) => await uniCloud.callFunction({name: 'cleanImage', data: params});
let isUpdateImageCache = async (params = {}) => await uniCloud.callFunction({name: 'updateImageCache', data: params});
const rulesApi = {
getAllProduct,
......@@ -53,7 +55,8 @@ const db = uniCloud.database({
saveImage,
getUserWatermark,
saveUserWatermark,
cleanImage
cleanImage,
isUpdateImageCache
}
return rulesApi
}
......
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
const imageVersion = await uniCloud.database().collection("dictionary").where({type: "standardImageVersion" }).limit(1).get()
//返回数据给客户端
return imageVersion.data[0].value > event.version
};
// 本文件中的json内容将在云函数【运行】时作为参数传给云函数。
// 配置教程参考:https://uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam
{"version":0
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment