mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
♻️ 当 code 大于 0 时同样需要进行相关的业务处理 https://github.com/siyuan-note/siyuan/pull/11367
This commit is contained in:
parent
c07a1a69db
commit
19dd387064
4 changed files with 9 additions and 14 deletions
|
|
@ -310,12 +310,10 @@ export const editor = {
|
||||||
if (fontFamilyElement.tagName === "SELECT") {
|
if (fontFamilyElement.tagName === "SELECT") {
|
||||||
let fontFamilyHTML = `<option value="">${window.siyuan.languages.default}</option>`;
|
let fontFamilyHTML = `<option value="">${window.siyuan.languages.default}</option>`;
|
||||||
fetchPost("/api/system/getSysFonts", {}, (response) => {
|
fetchPost("/api/system/getSysFonts", {}, (response) => {
|
||||||
if (response.code === 0) {
|
|
||||||
response.data.forEach((item: string) => {
|
response.data.forEach((item: string) => {
|
||||||
fontFamilyHTML += `<option value="${item}"${window.siyuan.config.editor.fontFamily === item ? " selected" : ""}>${item}</option>`;
|
fontFamilyHTML += `<option value="${item}"${window.siyuan.config.editor.fontFamily === item ? " selected" : ""}>${item}</option>`;
|
||||||
});
|
});
|
||||||
fontFamilyElement.innerHTML = fontFamilyHTML;
|
fontFamilyElement.innerHTML = fontFamilyHTML;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
editor.element.querySelector("#clearHistory").addEventListener("click", () => {
|
editor.element.querySelector("#clearHistory").addEventListener("click", () => {
|
||||||
|
|
|
||||||
|
|
@ -507,9 +507,8 @@ export const exportMd = (id: string) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (response.code === 0) {
|
|
||||||
showMessage(window.siyuan.languages.exportTplSucc);
|
|
||||||
}
|
}
|
||||||
|
showMessage(window.siyuan.languages.exportTplSucc);
|
||||||
});
|
});
|
||||||
dialog.destroy();
|
dialog.destroy();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -150,10 +150,8 @@ export const initAssets = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (response.code === 0) {
|
|
||||||
window.siyuan.config.appearance = response.data.appearance;
|
window.siyuan.config.appearance = response.data.appearance;
|
||||||
loadAssets(response.data.appearance);
|
loadAssets(response.data.appearance);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
|
||||||
return {
|
return {
|
||||||
data: null,
|
data: null,
|
||||||
msg: response.statusText,
|
msg: response.statusText,
|
||||||
code: response.status,
|
code: -response.status,
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
|
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue