完成项目管理模块的接口测试

This commit is contained in:
2025-04-18 17:22:57 +08:00
parent 434e1af3e8
commit 7a9e571a96
16 changed files with 91 additions and 74 deletions

View File

@ -103,8 +103,7 @@ class FullAdminAuth(AuthValidation):
telephone=telephone,
password=password,
v_return_none=True,
v_options=options,
is_staff=True
v_options=options
)
result = await self.validate_user(request, user, db, is_all=False)
permissions = self.get_user_permissions(user)

View File

@ -57,8 +57,6 @@ async def api_login_for_access_token(
raise CustomException(status_code=error_code, code=error_code, msg="手机号或密码错误")
if not user.is_active:
raise CustomException(status_code=error_code, code=error_code, msg="此手机号已被冻结")
elif not user.is_staff:
raise CustomException(status_code=error_code, code=error_code, msg="此手机号无权限")
access_token = LoginManage.create_token({"sub": user.telephone, "password": user.password})
record = LoginForm(platform='2', method='0', telephone=data.username, password=data.password)
resp = {"access_token": access_token, "token_type": "bearer"}

View File

@ -80,7 +80,7 @@ class LoginValidation:
await db.flush()
elif not user.is_active:
self.result.msg = "此手机号已被冻结!"
elif data.platform in ["0", "1"] and not user.is_staff:
elif data.platform in ["0", "1"]:
self.result.msg = "此手机号无权限!"
else:
if not DEMO and count: