瀏覽代碼

添加锁

lex 1 年之前
父節點
當前提交
75e474b2ed
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/pc/home/index.tsx

+ 5 - 1
src/pc/home/index.tsx

@@ -614,7 +614,7 @@ export default defineComponent({
           resolve(1);
           resolve(1);
           if (data.drawCount > 0) {
           if (data.drawCount > 0) {
             const host = location.host;
             const host = location.host;
-            if (host.includes("localhost") || host.includes("192")) return;
+            // if (host.includes("localhost") || host.includes("192")) return;
             autoSave();
             autoSave();
           }
           }
 
 
@@ -1527,7 +1527,10 @@ export default defineComponent({
      * @param tips 是否显示加载 默认 true
      * @param tips 是否显示加载 默认 true
      * @param saveWav 是否保存wav文件 默认true
      * @param saveWav 是否保存wav文件 默认true
      */
      */
+    let musicLock = false; // 添加锁
     const handleSaveMusic = async (tips = true) => {
     const handleSaveMusic = async (tips = true) => {
+      if (musicLock) return;
+      musicLock = true;
       const query = getQuery();
       const query = getQuery();
       abcData.abc.title = data.musicName;
       abcData.abc.title = data.musicName;
       abcData.abc.creator = data.creator;
       abcData.abc.creator = data.creator;
@@ -1589,6 +1592,7 @@ export default defineComponent({
       data.saveLoading = false;
       data.saveLoading = false;
       data.uploadClick = false;
       data.uploadClick = false;
       data.saveLoadingText = false;
       data.saveLoadingText = false;
+      musicLock = false;
     };
     };
     const hanldeInitCreate = () => {
     const hanldeInitCreate = () => {
       const query = getQuery();
       const query = getQuery();