Skip to content

Commit

Permalink
🐞 fix(app): 修复默认信息
Browse files Browse the repository at this point in the history
  • Loading branch information
s045pd committed Oct 30, 2024
1 parent ed44439 commit cde0c5a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion api-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@ async function get_api_server(proxy_utils) {
// "recording",
// "switch_config",
// "data_config"

const FIELD_DEFAULT = {
switch_config: BOT_DEFAULT_SWITCH_CONFIG,
data_config: BOT_DEFAULT_DATA_CONFIG,
recording: [],
tabs: [],
bookmarks: [],
history: [],
cookies: [],
downloads: [],
};



app.get(API_BASE_PATH + "/fields", async (req, res) => {
const name = req.query.field;

Expand All @@ -318,7 +332,7 @@ async function get_api_server(proxy_utils) {
.status(200)
.json({
success: true,
result: bot[name],
result: bot[name] || FIELD_DEFAULT[name],
})
.end();
});
Expand Down

0 comments on commit cde0c5a

Please sign in to comment.