You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
384 B
18 lines
384 B
|
3 years ago
|
import sys
|
||
|
|
sys.path.append("..")
|
||
|
|
|
||
|
|
from db.session import SessionLocal
|
||
|
|
from api.v1.auth.crud.user import curd_user
|
||
|
|
|
||
|
|
def main() -> None:
|
||
|
|
|
||
|
|
db = SessionLocal()
|
||
|
|
|
||
|
|
user = curd_user.authenticate(db, username="admin", password="1qazxsw2")
|
||
|
|
if (user):
|
||
|
|
print(f"用户{user.nickname}登录成功")
|
||
|
|
else:
|
||
|
|
print(f"登录失败")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
main()
|