完善投稿功能
This commit is contained in:
@@ -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)}"})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user