mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 00:14:07 +01:00
✨ Support read-only publish service
* 🎨 kernel supports read-only publishing services * 🐛 Fix authentication vulnerabilities * 🎨 Protect secret information * 🎨 Adjust the permission control * 🎨 Adjust the permission control * 🎨 Fixed the vulnerability that `getFile` gets file `conf.json` * 🎨 Add API `/api/setting/setPublish` * 🎨 Add API `/api/setting/getPublish` * 🐛 Fixed the issue that PWA-related files could not pass BasicAuth * 🎨 Add a settings panel for publishing features * 📝 Add guide for `Publish Service` * 📝 Update Japanese user guide * 🎨 Merge fixed static file services
This commit is contained in:
parent
536879cb84
commit
ba2193403d
47 changed files with 3690 additions and 375 deletions
|
|
@ -150,8 +150,10 @@ export const initAssets = () => {
|
|||
return;
|
||||
}
|
||||
}
|
||||
window.siyuan.config.appearance = response.data.appearance;
|
||||
loadAssets(response.data.appearance);
|
||||
if (response.code === 0) {
|
||||
window.siyuan.config.appearance = response.data.appearance;
|
||||
loadAssets(response.data.appearance);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,18 +32,20 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
|
|||
init.headers = headers;
|
||||
}
|
||||
fetch(url, init).then((response) => {
|
||||
if (response.status === 404) {
|
||||
return {
|
||||
data: null,
|
||||
msg: response.statusText,
|
||||
code: response.status,
|
||||
};
|
||||
} else {
|
||||
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
|
||||
return response.json();
|
||||
} else {
|
||||
return response.text();
|
||||
}
|
||||
switch (response.status) {
|
||||
case 403:
|
||||
case 404:
|
||||
return {
|
||||
data: null,
|
||||
msg: response.statusText,
|
||||
code: response.status,
|
||||
};
|
||||
default:
|
||||
if (response.headers.get("content-type")?.indexOf("application/json") > -1) {
|
||||
return response.json();
|
||||
} else {
|
||||
return response.text();
|
||||
}
|
||||
}
|
||||
}).then((response: IWebSocketData) => {
|
||||
if (typeof response === "string") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue