@deepwhale-cn/dsh-cn-doc-formatter 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +1 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -30,7 +30,7 @@ window.__ModuleLoader__.load({
30
30
  for (const f of files) payload.push({ name: (dir ? (f.webkitRelativePath || f.name) : f.name), data: await 读成base64(f) });
31
31
  const r = await fetch(API + '/upload', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ files: payload }) });
32
32
  const j = await r.json();
33
- if (!j.ok) { alert('上传失败:' + (j.error || '未知错误')); return resolve(null); }
33
+ if (!j.ok) { alert(j.error === 'not found' || /404/.test(String(j.error)) ? '插件后端还是旧版:重启 DSH 后这个按钮才生效。\n临时办法:直接在输入框粘贴文件路径,仍可用旧版继续。' : '上传失败:' + (j.error || '未知错误')); return resolve(null); }
34
34
  resolve(dir ? j.dir : j.path);
35
35
  } catch (e) { resolve(null); }
36
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepwhale-cn/dsh-cn-doc-formatter",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "中文公文排版:按 GB/T 9704-2012 生成 .docx / .pdf / .txt,附输出自检。不含字体文件,字体由用户自备。",
5
5
  "type": "module",
6
6
  "license": "MIT",