|
|
@@ -191,12 +191,18 @@ class LoginService:
|
|
|
pass # 测试阶段跳过短信验证码校验
|
|
|
|
|
|
# 根据手机号查找用户
|
|
|
- auth = AuthSchema(db=db)
|
|
|
- user = await UserCRUD(auth).get_by_mobile_crud(mobile=mobile)
|
|
|
+ from app.api.v1.module_system.user.model import UserModel
|
|
|
+ from sqlalchemy import select
|
|
|
+ stmt = select(UserModel).where(UserModel.mobile == mobile)
|
|
|
+ result = await db.execute(stmt)
|
|
|
+ user = result.scalar_one_or_none()
|
|
|
|
|
|
if not user:
|
|
|
+ log.error(f"短信登录-未找到用户: mobile={mobile}")
|
|
|
raise CustomException(msg="用户不存在")
|
|
|
|
|
|
+ log.info(f"短信登录-找到用户: id={user.id}, mobile={user.mobile}, status={user.status}")
|
|
|
+
|
|
|
if user.status == "1":
|
|
|
raise CustomException(msg="用户已被停用")
|
|
|
|