mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-02 05:43:18 +08:00
Add some logs
This commit is contained in:
@@ -129,20 +129,24 @@ async function gistBackup(req, res) {
|
||||
case "upload":
|
||||
content = $.read("#sub-store");
|
||||
await gist.upload(JSON.stringify(content));
|
||||
$.info(`上传备份中...`);
|
||||
break;
|
||||
case "download":
|
||||
content = await gist.download();
|
||||
// restore settings
|
||||
$.write(content,"#sub-store");
|
||||
$.info(`还原备份中...`);
|
||||
break;
|
||||
}
|
||||
res.json({
|
||||
status: "success",
|
||||
});
|
||||
} catch (err) {
|
||||
const msg = `${action === "upload" ? "上传" : "下载"}备份失败!${err}`;
|
||||
$.error(msg);
|
||||
res.status(500).json({
|
||||
status: "failed",
|
||||
message: `${action === "upload" ? "上传" : "下载"}备份失败!${err}`
|
||||
message: msg
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user