瀏覽代碼

提交页面

luogang 3 月之前
父節點
當前提交
94b9725950
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      plus-ui-ts/src/views/index.vue

+ 2 - 1
plus-ui-ts/src/views/index.vue

@@ -768,7 +768,8 @@ const htmlToPdfFn = async () => {
       const { title, contents } = extractTitleAndContents(editorRef.value.getHtml());
       reportForm.title = title;
       reportForm.content = contents.join('');
-      downloadFile(`loadFile/generate`, {
+      const url = import.meta.VITE_APP_ENV === 'development' ? 'loadFile/generate' : `${import.meta.env.VITE_APP_BASE_HOST}/generate`;
+      downloadFile(url, {
         method: 'POST',
         data: reportForm,
         filename: `${reportForm.title}.${reportForm.type}`,