mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
фикс авторизации1
This commit is contained in:
@@ -19,7 +19,7 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
# Include routers
|
||||
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
||||
app.include_router(auth.router, prefix="/auth", tags=["auth"])
|
||||
app.include_router(admin.router, prefix="/api/admin", tags=["admin"])
|
||||
app.include_router(employees.router, prefix="/api/employees", tags=["employees"])
|
||||
app.include_router(requests.router, prefix="/api/requests", tags=["requests"])
|
||||
|
@@ -5,6 +5,16 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Auth proxy
|
||||
location /auth/ {
|
||||
proxy_pass http://backend:8000/auth/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# API proxy
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8000/api/;
|
||||
|
@@ -64,7 +64,7 @@ export default {
|
||||
formData.append('username', this.username)
|
||||
formData.append('password', this.password)
|
||||
|
||||
const response = await axios.post('/api/auth/admin/login', formData)
|
||||
const response = await axios.post('/auth/admin/login', formData)
|
||||
|
||||
localStorage.setItem('admin_token', response.data.access_token)
|
||||
this.$router.push('/admin/dashboard')
|
||||
|
Reference in New Issue
Block a user