style: 使用ruff格式化登录模块,优化导入
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from sqlalchemy import select, and_
|
||||
from sqlalchemy import and_, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from module_admin.entity.do.user_do import SysUser
|
||||
from module_admin.entity.do.dept_do import SysDept
|
||||
from module_admin.entity.do.user_do import SysUser
|
||||
|
||||
|
||||
async def login_by_account(db: AsyncSession, user_name: str):
|
||||
@@ -11,11 +11,17 @@ async def login_by_account(db: AsyncSession, user_name: str):
|
||||
:param user_name: 用户名
|
||||
:return: 用户对象
|
||||
"""
|
||||
user = (await db.execute(
|
||||
select(SysUser, SysDept)
|
||||
user = (
|
||||
await db.execute(
|
||||
select(SysUser, SysDept)
|
||||
.where(SysUser.user_name == user_name, SysUser.del_flag == '0')
|
||||
.join(SysDept, and_(SysUser.dept_id == SysDept.dept_id, SysDept.status == '0', SysDept.del_flag == '0'), isouter=True)
|
||||
.join(
|
||||
SysDept,
|
||||
and_(SysUser.dept_id == SysDept.dept_id, SysDept.status == '0', SysDept.del_flag == '0'),
|
||||
isouter=True,
|
||||
)
|
||||
.distinct()
|
||||
)).first()
|
||||
)
|
||||
).first()
|
||||
|
||||
return user
|
||||
|
Reference in New Issue
Block a user