feat: ルートパスへのアクセスは顧客ログイン画面にリダイレクトさせる
This commit is contained in:
parent
65acc3ce09
commit
6f715e96e5
11
ecs/jskult-webapp/src/controller/root.py
Normal file
11
ecs/jskult-webapp/src/controller/root.py
Normal file
@ -0,0 +1,11 @@
|
||||
from fastapi import APIRouter
|
||||
from fastapi.responses import RedirectResponse
|
||||
from starlette import status
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get('/')
|
||||
def redirect_to_user_login():
|
||||
# ルートパスへのアクセスは、顧客ユーザーログイン画面にリダイレクトさせる
|
||||
return RedirectResponse(url='/login/userlogin', status_code=status.HTTP_303_SEE_OTHER)
|
||||
@ -5,7 +5,8 @@ from fastapi.staticfiles import StaticFiles
|
||||
from starlette import status
|
||||
|
||||
import src.static as static
|
||||
from src.controller import bio, bio_download, healthcheck, login, logout, menu
|
||||
from src.controller import (bio, bio_download, healthcheck, login, logout,
|
||||
menu, root)
|
||||
from src.core import tasks
|
||||
from src.error.exception_handler import http_exception_handler
|
||||
from src.error.exceptions import UnexpectedException
|
||||
@ -14,6 +15,8 @@ app = FastAPI()
|
||||
|
||||
# 静的ファイルをマウント
|
||||
app.mount('/static', StaticFiles(directory=path.dirname(static.__file__)), name='static')
|
||||
# ルートパス。顧客ログイン画面にリダイレクトさせる
|
||||
app.include_router(root.router)
|
||||
# ログイン関連のルーター
|
||||
app.include_router(login.router, prefix='/login')
|
||||
# ログアウト関連のルーター
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user