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.
26 lines
997 B
26 lines
997 B
from datetime import timedelta
|
|
from fastapi.security import OAuth2PasswordRequestForm
|
|
from fastapi import Depends, FastAPI, HTTPException, status
|
|
from dependencies import *
|
|
from internal.models import Token
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from routers import blogtype, usermanage,blogmanage,classticmanage,commonlinkmanage,labelmanage,diarymanage,diarytype,statistic,disbursemanage
|
|
app=FastAPI()
|
|
app.include_router(usermanage.router)
|
|
app.include_router(blogtype.router)
|
|
app.include_router(blogmanage.router)
|
|
app.include_router(diarymanage.router)
|
|
app.include_router(diarytype.router)
|
|
app.include_router(classticmanage.router)
|
|
app.include_router(commonlinkmanage.router)
|
|
app.include_router(labelmanage.router)
|
|
app.include_router(statistic.router)
|
|
app.include_router(disbursemanage.router)
|
|
# 解决跨域
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=['*'],
|
|
allow_credentials=True,
|
|
allow_methods=['GET', 'POST','DELETE','PUT'],
|
|
allow_headers=['*'],
|
|
)
|