Prechádzať zdrojové kódy

路径加上时间戳

黄琪勇 6 mesiacov pred
rodič
commit
b818719e8e
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 3 2
      src/store/pptWork.ts

+ 3 - 2
src/store/pptWork.ts

@@ -52,11 +52,12 @@ const useStore = defineStore("pptWork", {
       const { blob } = getJsonToBlob()
       fileUpload(`${this.id}ppt`, blob, `${this.id}/`, false, { isLoading: false })
         .then(url => {
+          const _time = Date.now()
           httpAjaxErrMsg(putTeacherChapterKnowledgeMaterial, {
             id: this.id,
             dataJson: JSON.stringify({
-              coverImg: this.coverImg,
-              jsonUrl: url
+              coverImg: this.coverImg + `?v=_${_time}`, // 加上时间戳,防止资源更新之后的缓存
+              jsonUrl: url + `?v=_${_time}`
             })
           }).then(res => {
             if (res.code === 200) {