mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-08 08:47:32 +08:00
[Enhance] Account Endpoints
- Adapt to new account registration and login endpoints. - For Arcaea 6.3.2
This commit is contained in:
@@ -23,7 +23,7 @@ def get_bps():
|
||||
return s
|
||||
|
||||
bp = Blueprint('server', __name__)
|
||||
list(map(bp.register_blueprint, [user.bp, auth.bp, friend.bp, score.bp,
|
||||
list(map(bp.register_blueprint, [user.bp2, user.bp, auth.bp, friend.bp, score.bp,
|
||||
world.bp, purchase.bp, present.bp, others.bp, multiplayer.bp, course.bp, mission.bp]))
|
||||
|
||||
bps = [Blueprint(x, __name__, url_prefix=x)
|
||||
|
||||
@@ -36,12 +36,6 @@ def login():
|
||||
return jsonify({"success": True, "token_type": "Bearer", 'user_id': user.user_id, 'access_token': user.token})
|
||||
|
||||
|
||||
@bp.route('/verify', methods=['POST']) # 邮箱验证进度查询
|
||||
@arc_try
|
||||
def email_verify():
|
||||
raise ArcError('Email verification unavailable.', 151, status=404)
|
||||
|
||||
|
||||
def auth_required(req):
|
||||
# arcaea登录验证,写成了修饰器
|
||||
def decorator(view):
|
||||
|
||||
@@ -14,8 +14,11 @@ from .func import arc_try, header_check, success_return
|
||||
|
||||
bp = Blueprint('user', __name__, url_prefix='/user')
|
||||
|
||||
bp2 = Blueprint('account', __name__, url_prefix='/account')
|
||||
|
||||
|
||||
@bp.route('', methods=['POST']) # 注册接口
|
||||
@bp2.route('', methods=['POST'])
|
||||
@arc_try
|
||||
def register():
|
||||
error = header_check(request)
|
||||
@@ -173,6 +176,7 @@ def sys_set(user_id, set_arg):
|
||||
|
||||
|
||||
@bp.route('/me/request_delete', methods=['POST']) # 删除账号
|
||||
@bp2.route('/me/request_delete', methods=['POST'])
|
||||
@auth_required(request)
|
||||
@arc_try
|
||||
def user_delete(user_id):
|
||||
@@ -183,6 +187,14 @@ def user_delete(user_id):
|
||||
|
||||
|
||||
@bp.route('/email/resend_verify', methods=['POST']) # 邮箱验证重发
|
||||
@bp2.route('/email/resend_verify', methods=['POST'])
|
||||
@arc_try
|
||||
def email_resend_verify():
|
||||
raise ArcError('Email verification unavailable.', 151, status=404)
|
||||
|
||||
|
||||
@bp.route('/verify', methods=['POST']) # 邮箱验证状态查询
|
||||
@bp2.route('/verify', methods=['POST'])
|
||||
@arc_try
|
||||
def email_verify():
|
||||
raise ArcError('Email verification unavailable.', 151, status=404)
|
||||
|
||||
Reference in New Issue
Block a user