feat: external API for Java server integration with dedicated key

This commit is contained in:
2026-07-13 01:24:03 +08:00
parent 8ae02dd115
commit ea3cd67e02
3 changed files with 82 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ router.post('/complete', async (req, res) => {
const jwtSecret = crypto.randomBytes(32).toString('hex');
const apiKey = crypto.randomBytes(24).toString('hex');
const externalKey = crypto.randomBytes(24).toString('hex');
for (const [k, v, l] of [
['site_name', site_name || 'MC举报系统', '站点名称'],
@@ -86,6 +87,7 @@ router.post('/complete', async (req, res) => {
db_user, db_pass: db_pass || '', db_name,
jwt_secret: jwtSecret,
api_key: apiKey,
external_api_key: externalKey,
});
res.json({ ok: true, message: '安装完成,请重新启动服务器' });