1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

фикс авторизации1

This commit is contained in:
MoonTestUse1
2025-01-03 20:38:16 +06:00
parent 921cc4421f
commit b9fbad1d20
3 changed files with 12 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ app.add_middleware(
) )
# Include routers # 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(admin.router, prefix="/api/admin", tags=["admin"])
app.include_router(employees.router, prefix="/api/employees", tags=["employees"]) app.include_router(employees.router, prefix="/api/employees", tags=["employees"])
app.include_router(requests.router, prefix="/api/requests", tags=["requests"]) app.include_router(requests.router, prefix="/api/requests", tags=["requests"])

View File

@@ -5,6 +5,16 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.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 # API proxy
location /api/ { location /api/ {
proxy_pass http://backend:8000/api/; proxy_pass http://backend:8000/api/;

View File

@@ -64,7 +64,7 @@ export default {
formData.append('username', this.username) formData.append('username', this.username)
formData.append('password', this.password) 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) localStorage.setItem('admin_token', response.data.access_token)
this.$router.push('/admin/dashboard') this.$router.push('/admin/dashboard')