添加用户登录接口
This commit is contained in:
parent
3a271cd11a
commit
e243749f00
|
|
@ -34,6 +34,6 @@ def login(user: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get
|
|||
user = login_user(db, user.username, user.password)
|
||||
if user[0]:
|
||||
expire_time = timedelta(minutes=settings.ACCESS.ACCESS_TOKEN_EXPIRE_MINUTES)
|
||||
token = create_token(AutomationResponse.model_to_dict(user[1], "password"), expire_time)
|
||||
return {"code": 200, "message": "登录成功", "access_token": token, "user": user[1], "token_type": "Bearer"}
|
||||
token = create_token(AutomationResponse.model_to_dict(user[1]), expire_time)
|
||||
return {"code": 200, "message": "登录成功", "access_token": token, "user": AutomationResponse.model_to_dict(user[1], "password"), "token_type": "Bearer"}
|
||||
return error_211(message=user[1])
|
||||
|
|
|
|||
|
|
@ -404,3 +404,141 @@
|
|||
2022-05-29 12:10:12 | MainThread:8635991552 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:10:17 | MainThread:8604014080 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:10:17 | MainThread:8604014080 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:22 | MainThread:8627721728 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:23 | MainThread:8632165888 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:52 | MainThread:8604878336 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:11:53 | MainThread:8592856576 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:13:23 | MainThread:8637900288 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:13:24 | MainThread:8605115904 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:14:32 | MainThread:8668530176 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:14:32 | MainThread:8668530176 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:14:33 | MainThread:8668530176 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:16:20 | MainThread:8640644608 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:16:20 | MainThread:8640644608 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:16:21 | MainThread:8640644608 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:15 - INFO - loading application configuration
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:16 - INFO - create FastApi app object
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:25 - INFO - Adding a New route success
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:26 - INFO - Start registering middleware
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:36 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:37 - INFO - Server address http://192.168.1.107:8000
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:38 - INFO - Api doc address http://192.168.1.107:8000/docs
|
||||
2022-05-29 12:16:37 | MainThread:8636753408 | create_app:app:39 - INFO - Api redoc address http://192.168.1.107:8000/redoc
|
||||
|
|
|
|||
Loading…
Reference in New Issue