This commit is contained in:
Daniel 2024-09-26 16:27:48 +08:00
parent 694303e5e8
commit 77eb65087c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 14 additions and 2 deletions

View file

@ -9,6 +9,8 @@ import {showMessage} from "../dialog/message";
import {showFileInFolder} from "../util/pathName";
import {Constants} from "../constants";
import {openByMobile} from "../protyle/util/compatibility";
import {exportLayout} from "../layout/util";
import {exitSiYuan} from "../dialog/processSystem";
export const exportConfig = {
element: undefined as Element,
@ -234,7 +236,18 @@ export const exportConfig = {
item.addEventListener("change", (event: InputEvent & { target: HTMLInputElement }) => {
const formData = new FormData();
formData.append("file", event.target.files[0]);
fetchPost("/api/system/importConf", formData);
fetchPost("/api/system/importConf", formData, response => {
if (response.code !== 0) {
showMessage(response.msg);
return
}
showMessage(window.siyuan.languages.imported);
exportLayout({
errorExit: true,
cb: exitSiYuan
});
});
});
} else {
item.addEventListener("change", () => {

View file

@ -410,7 +410,6 @@ func importConf(c *gin.Context) {
}
logging.LogInfof("imported conf")
model.Close(false, true, 1)
}
func getConf(c *gin.Context) {