15 lines
397 B
Python
15 lines
397 B
Python
from flask import Blueprint, request
|
|
from common.response import success
|
|
from services.auth_service import AuthService
|
|
|
|
auth_bp = Blueprint("auth", __name__, url_prefix="/api/auth")
|
|
|
|
@auth_bp.post("/login")
|
|
def login():
|
|
body = request.get_json()
|
|
username = body.get("username")
|
|
password = body.get("password")
|
|
|
|
data = AuthService.login(username, password)
|
|
return success(data)
|