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
@@ -47,20 +47,10 @@
//console.log(this.message);
const self = this;
let audio = this.message.soundElem;
//soundPath
// 如果有远程 snapshotUrl,则下载到 cachePath
const snapshotUrl = audio.sourceUrl;
const key = md5(snapshotUrl || '');
const save_file_name = `audio_${key}.${audio.soundType}`;
const cachePath = `${this.conversationID}/${save_file_name}`;
if (typeof plus === 'undefined' || !cachePath) return;
util.cacheFile(snapshotUrl,cachePath,(fn)=>{
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
self.src = fn;
//console.log(fn);
},(e)=>{
console.log(e);
},(e)=>{
console.log(e);
});
},
handleAudio(){