Преглед на файлове

:bug: 导出 word 定位

Vanessa преди 2 години
родител
ревизия
e40d334c7a
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      app/src/editor/rename.ts
  2. 1 1
      app/src/protyle/export/index.ts

+ 1 - 1
app/src/editor/rename.ts

@@ -36,7 +36,7 @@ export const replaceFileName = (name: string) => {
 };
 };
 
 
 export const replaceLocalPath = (name: string) => {
 export const replaceLocalPath = (name: string) => {
-    return name.replace(/\\\\|\/|:|\*|\?|\\|'|<|>|\|/g, "");
+    return name.replace(/\\\\|\/|"|:|\*|\?|\\|'|<|>|\|/g, "");
 };
 };
 
 
 export const rename = (options: {
 export const rename = (options: {

+ 1 - 1
app/src/protyle/export/index.ts

@@ -505,7 +505,7 @@ const getExportPath = (option: { type: string, id: string }, removeAssets?: bool
                             hideMessage(msgId);
                             hideMessage(msgId);
                             return;
                             return;
                         }
                         }
-                        afterExport(savePath, msgId);
+                        afterExport(path.join(savePath, replaceLocalPath(response.data.rootTitle)) + ".docx", msgId);
                     } else {
                     } else {
                         onExport(exportResponse, savePath, option.type, removeAssets, msgId);
                         onExport(exportResponse, savePath, option.type, removeAssets, msgId);
                     }
                     }