filecache

This commit is contained in:
cansnow
2025-12-27 07:08:30 +08:00
parent 974d149d25
commit 09c7889525
54 changed files with 10485 additions and 164 deletions
@@ -28,7 +28,6 @@
<script>
import util from "@/util"
import md5 from "md5";
export default {
name: "LocationMessageRender",
components: {},
@@ -78,23 +77,14 @@
},
async init(){
const self = this;
let url = "";
// 如果有远程 snapshotUrl,则下载到 coverCachePath
const snapshotUrl = this.apisrc ;
const key = md5(snapshotUrl || '');
const dir_name = `${this.conversationID}`;
const save_file_name = `loc_${key}.png`;
const coverCachePath = `${dir_name}/${save_file_name}`;
if (typeof plus === 'undefined' || !coverCachePath) return;
self.coverDownloading = true;
util.cacheFile(snapshotUrl,coverCachePath,(fn)=>{
util.cacheFile(snapshotUrl,dir_name).then((fn)=>{
self.coverDownloading = false;
self.getImageInfo(fn);
//console.log(fn);
},(e)=>{
console.log(e);
},(e)=>{
console.log(e);
});
},
clickMediaItem() {