@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.
- package/lib/client.js +1 -1
- 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
|
};
|