Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

90 91/feat/tela perdidos redirecionamento #97

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified API/AcheiUnB/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified API/AcheiUnB/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file modified API/AcheiUnB/__pycache__/wsgi.cpython-312.pyc
Binary file not shown.
10 changes: 7 additions & 3 deletions API/AcheiUnB/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['0.0.0.0']


# Application definition
Expand Down Expand Up @@ -100,7 +100,7 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [BASE_DIR / "templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down Expand Up @@ -182,7 +182,11 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = "static/"
STATIC_URL = '/static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, "AcheiUnB/static/dist"), # Diretório dos arquivos do Vue.js
]

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
Expand Down
1 change: 1 addition & 0 deletions API/AcheiUnB/static/dist/index-BM3zXh8p.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions API/AcheiUnB/static/dist/index-CsmleIEa.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions API/AcheiUnB/static/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<!-- <link rel="icon" href="/favicon.ico"> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AcheiUnB</title>
<script type="module" crossorigin src="/index-CsmleIEa.js"></script>
<link rel="stylesheet" crossorigin href="/index-BM3zXh8p.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
9 changes: 7 additions & 2 deletions API/AcheiUnB/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@
TokenObtainPairView,
TokenRefreshView,
)
from django.shortcuts import render

# View para servir o arquivo Vue.js
def vue_app(request):
return render(request, 'index.html') # Caminho para o index.html dentro da pasta templates

urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')), # Rotas do Allauth para login pelo Microsoft
path('', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'),
path('', include('users.urls')), # Inclui as rotas do app "users"
path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'),
path('', vue_app, name='vue_home'), # Essa URL renderiza o arquivo index.html
path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), # Obter token de acesso e refresh
path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), # Atualizar token de acesso
path('api/chat/', include('chat.urls')),
Expand Down
Binary file modified API/users/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified API/users/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file modified API/users/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file modified API/users/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file modified API/users/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file modified API/users/migrations/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
15 changes: 15 additions & 0 deletions API/users/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% load static %}

<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AcheiUnB</title>
<link rel="stylesheet" href="{% static 'index-BM3zXh8p.css' %}">
</head>
<body>
<div id="app"></div>
<script src="{% static 'index-CsmleIEa.js' %}"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions web/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class="flex items-center rounded-full bg-gray-50 px-5 py-3 text-md font-medium text-azul ring-1 ring-inset ring-gray-500/10"
>
<img
src="../components/icons/Microsoft_logo.svg"
src="../components/icons/Microsoft_logo2.svg"
alt="Logo Microsoft"
class="h-6 w-auto mr-2"
/>
Expand Down Expand Up @@ -62,7 +62,7 @@ window.addEventListener("load", () => {

function redirectToLoginMicrosoft() {
window.location.href =
"http://localhost:8000/accounts/microsoft/login/callback/?code=1.AQoAoZs17AtjK024M8jm1I-AWaQndEAgaUlFgMa8dyuNqUUKAEsKAA.AgABBAIAAADW6jl31mB3T7ugrWTT8pFeAwDs_wUA9P9MZdKMoEzV5HiWul9EpMcaWKfGBT0keLmk9c-rCvbWkOxjVSGoUAMeU6cAae8lWykGXY-tzhlJL6cUPo_1F1vEPTJPL-vd3xiMZhexpdE1KrfxPUJaUfkyZf83gIq6lH5iY8rjmPDncnEGE-QiawLZBcUGrUbCd6yeBV1N2v5tJcUIL0qnOPX55XDo22hEKnC-AGK-PimzMAB66TIfwOmMEmoA-3Oga80t8c6Y3h0fVCbx5znZHoziSu1xaG9f0ZeptIAuZUn_GStwiBVua8wstZ7ETcqmauX6KJIIl2TIUZ_UGDmzlOM-5cAyl6X8K0d-qjQ6ojSppdPt5ZuMXjFJO7uTqxpFfz6z5QoU_JxlG264WmVlGOwZ6LlMVHv29zSeE__3siJqpsnnvqnhMEbsIpxxwHi54esBWwhTEtp70fmDo9QdOzALuUyiCXm09ucno-2c4Xbf7v1NQgbWlzEhzrDVAOM-OKD19B5UMRhqHYbjUwQjjmXm390DoYKNDX3OZbvY5RHiV48Xlw3pH9TtTlyLGgOeX4TkGFSpaorkoRKpf7Ra05vD5pWkY2-w3X0zkWwvjK_CPkqn-6Noj-KNGtAmdzc7CZDY8CkjV7malOf8qHw2JgPP7M2a9jzjk6hNOi0ZKBe1WQBTXDzxzykjHZt1_5Mruo2FDo6mSIr4UcftjCgLf1b7Asd9yIHWSmCA8YhXFWBG8wlI6bNLMj-ytwOcjKYlTdkRTeKT&state=Zay5NfY4tSn7JgvO&session_state=22111dff-b57b-4d45-97be-8c7ffaf3d2b7#";
"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=407427a4-6920-4549-80c6-bc772b8da945&redirect_uri=http%3A%2F%2Flocalhost%3A5173%2Faccounts%2Fmicrosoft%2Flogin%2Fcallback%2F&scope=User.Read&response_type=code&state=Zay5NfY4tSn7JgvO&domain=alunos.unb.br";
}
</script>

Expand Down
5 changes: 5 additions & 0 deletions web/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import path from 'path';

// https://vite.dev/config/
export default defineConfig({
Expand All @@ -18,4 +19,8 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
build: {
outDir: path.resolve(__dirname, '../API/AcheiUnB/static/dist'), // Diretório de saída
assetsDir: './', // Configura o caminho relativo para assets
},
})
Loading