瀏覽代碼

🎈 perf: 上传空取之前的数据

wolyshaw 3 年之前
父節點
當前提交
a9d946240f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/teacher/music/upload/index.tsx

+ 2 - 2
src/teacher/music/upload/index.tsx

@@ -196,7 +196,7 @@ export default defineComponent({
       this.xmlFileLoading = true
       postMessage({ api: 'chooseFile', content: { type: 'xml' } }, evt => {
         // @ts-ignore
-        this.xmlFileUrl = evt?.fileUrl || ''
+        this.xmlFileUrl = evt?.fileUrl || this.this.xmlFileUrl || ''
         this.xmlFileLoading = false
       })
     },
@@ -204,7 +204,7 @@ export default defineComponent({
       this.midiLoading = true
       postMessage({ api: 'chooseFile', content: { type: 'midi' } }, evt => {
         // @ts-ignore
-        this.midiUrl = evt?.fileUrl || ''
+        this.midiUrl = evt?.fileUrl || this.midiUrl || ''
         this.midiLoading = false
         // this.midiUrl = path
       })