完善投稿功能

This commit is contained in:
2026-01-23 13:46:20 +08:00
parent 50371f9a2e
commit abae2e266a
4 changed files with 137 additions and 4 deletions

View File

@@ -116,7 +116,7 @@ def get_about():
# about在初始化时不会被设置避免管理面板报错返回默认文本
return jsonify({
"code": 1000,
"data": "# 默认关于页面\n关于页面未设置,请前往管理面板。"
"data": "# 默认关于页面\n关于页面未设置,请前往管理面板操作"
})
@app.route('/api/get_id_token', methods=['GET'])
@@ -197,7 +197,8 @@ def submit_post():
db.session.add(new_post)
db.session.commit()
return jsonify({"code": 1000, "data": "投稿成功"})
code = 1002 if new_post.status == 'Pending' else 1001
return jsonify({"code": code, "data": {"id": new_post.id}})
except Exception as e:
return jsonify({"code": 2003, "data": f"投稿失败: {str(e)}"})