support init database
This commit is contained in:
1 parent
1e3e39284a
commit
ac331dc9c9
16 files changed
+517
-4
No files matched your search
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@ from sqlalchemy.orm import sessionmaker
|
||||
from sqlalchemy.orm import declarative_base
|
||||
|
||||
|
||||
DATABASE_URL = "mysql+pymysql://root:example@localhost:3306/wncloud?charset=utf8mb4"
|
||||
DATABASE_URL = "mysql+pymysql://root:C3nvsoWP5Nhe@wncloud-mysql:3306/wncloud?charset=utf8mb4"
|
||||
engine = create_engine(DATABASE_URL)
|
||||
SessionLocal = sessionmaker(autoflush=False, bind=engine)
|
||||
Base = declarative_base()
|
||||
Binary file not shown.
Binary file not shown.
+2
-2
@@ -1,4 +1,4 @@
|
||||
import jwt
|
||||
from jose import jwt
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
from fastapi import Depends, HTTPException, status
|
||||
@@ -25,7 +25,7 @@ def get_current_user(
|
||||
try:
|
||||
payload = decode_token(token)
|
||||
print(payload)
|
||||
except jwt.JWTError:
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Could not validate credentials",
|
||||
|
||||
Reference in new issue
Block a user