From 4e31a4a8b81d105ee4462fcdbd330a63f7fbb735 Mon Sep 17 00:00:00 2001 From: TiagoBalieiro Date: Wed, 27 Nov 2024 15:20:23 -0300 Subject: [PATCH 01/14] =?UTF-8?q?Mudan=C3=A7as=20para=20que=20o=20tailwind?= =?UTF-8?q?=20CSS=20funcione=20corretamente,=20cria=C3=A7=C3=A3o=20do=20ar?= =?UTF-8?q?quivo=20da=20tela=20de=20Login=20e=20adi=C3=A7=C3=A3o=20de=20ro?= =?UTF-8?q?tas.=20\n\nO=20tailwind=20n=C3=A3o=20estava=20funcionando=20cor?= =?UTF-8?q?retamente,=20havia=20um=20arquivo=20que=20deveria=20existir=20q?= =?UTF-8?q?ue=20n=C3=A3o=20existia,=20o=20postcss.config.=20Foi=20adiciona?= =?UTF-8?q?do=20ele=20e=20tamb=C3=A9m=20foram=20adicionadas=20as=20cores?= =?UTF-8?q?=20do=20projeto=20no=20arquivo=20tailwind.config.=20Agora=20bas?= =?UTF-8?q?ta=20escer=20azul,=20laranja=20ou=20verde=20para=20usar=20as=20?= =?UTF-8?q?cores=20do=20projeto.=20\n\nNa=20pasta=20views=20foi=20criado?= =?UTF-8?q?=20o=20arquivo=20da=20tela=20de=20Login=20o=20qual=20irei=20com?= =?UTF-8?q?e=C3=A7ar=20a=20implementa=C3=A7=C3=A3o=20e=20foi=20configurado?= =?UTF-8?q?=20a=20sua=20rota.=20No=20arquivo=20index.js=20o=20createRouter?= =?UTF-8?q?=20e=20createWebHashHistory=20s=C3=A3o=20importados=20do=20Vue-?= =?UTF-8?q?Router.=20Dentro=20do=20array=20routes=20s=C3=A3o=20adicionadas?= =?UTF-8?q?=20as=20rotas=20e=20para=20qual=20componente=20ou=20view=20ela?= =?UTF-8?q?=20ir=C3=A1=20direcionar.=20Na=20vari=C3=A1vel=20router=20?= =?UTF-8?q?=C3=A9=20configurado=20o=20modo=20como=20as=20rotas=20s=C3=A3o?= =?UTF-8?q?=20gerenciadas.=20O=20createWebHashHistory=20adiciona=20uma=20h?= =?UTF-8?q?ashtag=20a=20URL=20por=C3=A9m=20n=C3=A3o=20necessita=20de=20con?= =?UTF-8?q?figura=C3=A7=C3=A3o=20adicional=20no=20backend=20como=20redirec?= =?UTF-8?q?ionamento=20do=20servidor.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/postcss.config.cjs | 7 ++++ web/src/App.vue | 2 + web/src/assets/base.css | 86 ----------------------------------------- web/src/assets/main.css | 36 +---------------- web/src/router/index.js | 15 ++++++- web/src/views/Login.vue | 16 ++++++++ web/tailwind.config.js | 12 +++++- web/vite.config.js | 3 ++ 8 files changed, 53 insertions(+), 124 deletions(-) create mode 100644 web/postcss.config.cjs create mode 100644 web/src/views/Login.vue diff --git a/web/postcss.config.cjs b/web/postcss.config.cjs new file mode 100644 index 00000000..f3b817e8 --- /dev/null +++ b/web/postcss.config.cjs @@ -0,0 +1,7 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, + }; + \ No newline at end of file diff --git a/web/src/App.vue b/web/src/App.vue index 441f32a5..5554299f 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -4,6 +4,8 @@ import { RouterLink, RouterView } from 'vue-router' \ No newline at end of file diff --git a/web/tailwind.config.js b/web/tailwind.config.js index c189a4a5..22137182 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -1,8 +1,16 @@ /** @type {import('tailwindcss').Config} */ export default { - content: [], + content: [ + './src/views/Login.vue' + ], theme: { - extend: {}, + extend: { + colors: { + azul: '#133E78', + laranja: '#F59E0B', + verde: '#008940' + } + }, }, plugins: [], } diff --git a/web/vite.config.js b/web/vite.config.js index 4217010a..8ebd6ffe 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -10,6 +10,9 @@ export default defineConfig({ vue(), vueDevTools(), ], + css: { + postcss: './postcss.config.cjs', + }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) From 8cc0d8115377744066731c4519a7f5314f2d906f Mon Sep 17 00:00:00 2001 From: TiagoBalieiro Date: Wed, 27 Nov 2024 15:37:32 -0300 Subject: [PATCH 02/14] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20arquivos=20vazios?= =?UTF-8?q?=20a=20pasta=20components=20e=20icons=20para=20rastreamento=20d?= =?UTF-8?q?elas=20no=20github.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/.gitkeep | 0 web/src/components/icons/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/src/components/.gitkeep create mode 100644 web/src/components/icons/.gitkeep diff --git a/web/src/components/.gitkeep b/web/src/components/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/web/src/components/icons/.gitkeep b/web/src/components/icons/.gitkeep new file mode 100644 index 00000000..e69de29b From d08e4f2756d5c2c7c6d2d19818f09f64f1ce4f01 Mon Sep 17 00:00:00 2001 From: Ana Elisa Ramos Date: Wed, 27 Nov 2024 22:45:57 -0300 Subject: [PATCH 03/14] feat(web): add logo component Add Logo Vue component --- web/src/App.vue | 10 +++------- web/src/components/Logo.vue | 13 +++++++++++++ web/src/main.js | 14 +++++++------- web/src/router/index.js | 34 ++++++++++++++++++++-------------- web/src/views/About.vue | 7 +++++++ web/src/views/Login.vue | 17 +++++++---------- web/tailwind.config.js | 15 ++++++++------- 7 files changed, 65 insertions(+), 45 deletions(-) create mode 100644 web/src/components/Logo.vue create mode 100644 web/src/views/About.vue diff --git a/web/src/App.vue b/web/src/App.vue index 5554299f..3680ea16 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,13 +1,9 @@ - + diff --git a/web/src/components/Logo.vue b/web/src/components/Logo.vue new file mode 100644 index 00000000..d223fca1 --- /dev/null +++ b/web/src/components/Logo.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/web/src/main.js b/web/src/main.js index 5a5dbdba..7a9c7a85 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -1,11 +1,11 @@ -import './assets/main.css' +import "./assets/main.css"; -import { createApp } from 'vue' -import App from './App.vue' -import router from './router' +import { createApp } from "vue"; +import App from "./App.vue"; +import router from "./router"; -const app = createApp(App) +const app = createApp(App); -app.use(router) +app.use(router); -app.mount('#app') +app.mount("#app"); diff --git a/web/src/router/index.js b/web/src/router/index.js index fdc7391b..bb8bd734 100644 --- a/web/src/router/index.js +++ b/web/src/router/index.js @@ -1,17 +1,23 @@ -import { createRouter, createWebHashHistory } from 'vue-router' -import Login from "../views/Login.vue" +import { createRouter, createWebHashHistory } from "vue-router"; +import Login from "../views/Login.vue"; +import About from "../views/About.vue"; const routes = [ - { - path: "/", - name: "Login", - component: Login, - }, - ]; - - const router = createRouter({ - history: createWebHashHistory(), // Usar histórico do navegador - routes, - }); + { + path: "/", + name: "Login", + component: Login, + }, + { + path: "/about", + name: "About", + component: About, + }, +]; -export default router +const router = createRouter({ + history: createWebHashHistory(), // Usar histórico do navegador + routes, +}); + +export default router; diff --git a/web/src/views/About.vue b/web/src/views/About.vue new file mode 100644 index 00000000..cf428b50 --- /dev/null +++ b/web/src/views/About.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index 9dc718d8..aa171848 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -1,16 +1,13 @@ - \ No newline at end of file + diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 22137182..6f5625e4 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -1,17 +1,18 @@ /** @type {import('tailwindcss').Config} */ export default { content: [ - './src/views/Login.vue' + "./src/views/Login.vue", + "./src/views/About.vue", + "./src/components/Logo.vue", ], theme: { extend: { colors: { - azul: '#133E78', - laranja: '#F59E0B', - verde: '#008940' - } + azul: "#133E78", + laranja: "#F59E0B", + verde: "#008940", + }, }, }, plugins: [], -} - +}; From 15d7c1238d24fc14409aa1b07eeb260dd36bad2f Mon Sep 17 00:00:00 2001 From: Potatoyz908 Date: Fri, 29 Nov 2024 12:25:45 -0300 Subject: [PATCH 04/14] feat(login): redireciona o login para a home page --- API/AcheiUnB/__pycache__/urls.cpython-312.pyc | Bin 1701 -> 1693 bytes API/AcheiUnB/settings.py | 2 +- API/AcheiUnB/urls.py | 2 +- API/users/__pycache__/models.cpython-312.pyc | Bin 1445 -> 1445 bytes API/users/__pycache__/views.cpython-312.pyc | Bin 2416 -> 2416 bytes 5 files changed, 2 insertions(+), 2 deletions(-) diff --git a/API/AcheiUnB/__pycache__/urls.cpython-312.pyc b/API/AcheiUnB/__pycache__/urls.cpython-312.pyc index c64e24fe5e7badaed3748adb05dfd54f3aa0a805..6ce22caec9bf2c7f09751465118f1cd1de15bcb8 100644 GIT binary patch delta 137 zcmZ3=JC~RDG%qg~0}#mG@l3Cp$oq$#lZhdfHHB}o0HY`?KakBeIfhYIP+$%3YG#l+ z1_q!QON!v+2u4L=A%ti;Ta-Yhu%^i79>#A>Ot%;&cd;04-p5kKC@0hrb)8r7BCq0g dUd@ZVninj*F7Rqz=Jmc16nTXuYH}ExKL9P!BHsW2 delta 146 zcmbQsyOfvrG%qg~0}!+bJEk{GfKilH0LbQ=9K$FpD7c1qH8V&Z z0|QWuB}Hg*1f!y`FhVq)ElQwLL{oHg592o`jw-gC{PfH`{mCsXMohODHg998Vw97Z mV0B$s{i3k?bz%LB!ul8N0xk&aUltC$5D|ZcC1J83n?C?IA0?Fl diff --git a/API/AcheiUnB/settings.py b/API/AcheiUnB/settings.py index bd286a41..96feacf6 100644 --- a/API/AcheiUnB/settings.py +++ b/API/AcheiUnB/settings.py @@ -176,6 +176,6 @@ SITE_ID = 1 LOGIN_REDIRECT_URL = "/certu" -LOGOUT_REDIRECT_URL = "/login/" +LOGOUT_REDIRECT_URL = "" MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage" LANGUAGE_CODE = "pt-br" diff --git a/API/AcheiUnB/urls.py b/API/AcheiUnB/urls.py index b577ffa5..257a8610 100644 --- a/API/AcheiUnB/urls.py +++ b/API/AcheiUnB/urls.py @@ -25,7 +25,7 @@ urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), # Rotas do Allauth para login pelo Microsoft - path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'), + path('', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'), path('', include('users.urls')), # Inclui as rotas do app "users" 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 diff --git a/API/users/__pycache__/models.cpython-312.pyc b/API/users/__pycache__/models.cpython-312.pyc index 4e6b4066b6baee04cc7cd47bbe1ca3b0021b5759..d83657d8368833d5d101cb64a557b1a275d8bb22 100644 GIT binary patch delta 20 acmZ3=y_B2#G%qg~0}y<<=DCr37ApWb#RbU# delta 20 acmZ3=y_B2#G%qg~0}y->aNNi}ixmJg`2_m_ diff --git a/API/users/__pycache__/views.cpython-312.pyc b/API/users/__pycache__/views.cpython-312.pyc index 7ba26cb8555be91fd845bab1bca3c5a1ec9eddf0..55eb90916556da4b8295fa451ca3a54513801014 100644 GIT binary patch delta 20 acmew$^g)RGG%qg~0}y<<=DCqOl@kC(eFi)L delta 20 acmew$^g)RGG%qg~0}#BCcihOG$_W5K(*<<^ From ace7ba368e222dedbd5b6e32b77b7e4b271440d6 Mon Sep 17 00:00:00 2001 From: TiagoBalieiro Date: Fri, 29 Nov 2024 18:52:25 -0300 Subject: [PATCH 05/14] =?UTF-8?q?Mudan=C3=A7as=20na=20tela=20de=20Login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/.gitkeep | 0 web/src/components/icons/Microsoft_logo.svg | Bin 0 -> 1584 bytes web/src/views/Login.vue | 28 +++++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) delete mode 100644 web/src/components/.gitkeep create mode 100644 web/src/components/icons/Microsoft_logo.svg diff --git a/web/src/components/.gitkeep b/web/src/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/web/src/components/icons/Microsoft_logo.svg b/web/src/components/icons/Microsoft_logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..3e62d6dc3d0eff604b2beda60ddf206d3ee28cf7 GIT binary patch literal 1584 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&w@L)Zt|+Cx8@7x}&cn1H;CC?mvmFK)yn< zN02WALzNl>LqiJ#!!Mvv!wUw6QUeBtR|yOZRx=nF#0%!^3bX-A_yzccxPAtLInAGI zqdxcKueuOD|CICAt3{uKRX?ZO^&e7h+{5;{GHlLC`=~=7mDYc-+wt+w35UN2Rezt4 zao+Wjb=imiyEy)wbS*mh>DQIw|NsA+J`T(Qn#`Ew?d~G^CU0v8ki%Z$>Fdh=f}M?3 zn{{Dibsx~t_dQ)4Ln>~)y>wErDS(01F(oj-kl&Da7?@g_7+V>bXd4(<85sPQ@wkJc cAvZrIGp!Q0hAzhs2|x`Dp00i_>zopr00IQKhX4Qo literal 0 HcmV?d00001 diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index aa171848..ac493f11 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -1,13 +1,27 @@ - + \ No newline at end of file From 85b8a17bb01fd33891a5abd7c657f9fd1c692494 Mon Sep 17 00:00:00 2001 From: Ana Elisa Ramos Date: Sat, 30 Nov 2024 16:56:40 -0300 Subject: [PATCH 06/14] =?UTF-8?q?feat(web):=20adiciona=20instala=C3=A7?= =?UTF-8?q?=C3=A3o=20do=20axios=20em=20web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inslação do axios e criação da pasta de servicies, bem como do serviço para o axios, que será usado por injeção de dependência em outros lugares. Ref #83 --- web/package-lock.json | 91 +++++++++++++++++++++++++++++++++++++++ web/package.json | 1 + web/src/services/axios.js | 8 ++++ 3 files changed, 100 insertions(+) create mode 100644 web/src/services/axios.js diff --git a/web/package-lock.json b/web/package-lock.json index 4851bcf2..2e70aa76 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -8,6 +8,7 @@ "name": "acheiunb", "version": "0.0.0", "dependencies": { + "axios": "^1.7.8", "vue": "^3.5.12", "vue-router": "^4.4.5" }, @@ -387,6 +388,11 @@ "dev": true, "license": "MIT" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "node_modules/autoprefixer": { "version": "10.4.20", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", @@ -425,6 +431,16 @@ "postcss": "^8.1.0" } }, + "node_modules/axios": { + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -590,6 +606,17 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -628,6 +655,14 @@ "node": ">=4" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -864,6 +899,25 @@ "node": ">=8" } }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", @@ -881,6 +935,19 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -1120,6 +1187,25 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -1465,6 +1551,11 @@ "dev": true, "license": "MIT" }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", diff --git a/web/package.json b/web/package.json index 544d576d..16f6601e 100644 --- a/web/package.json +++ b/web/package.json @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "axios": "^1.7.8", "vue": "^3.5.12", "vue-router": "^4.4.5" }, diff --git a/web/src/services/axios.js b/web/src/services/axios.js new file mode 100644 index 00000000..152ed0bf --- /dev/null +++ b/web/src/services/axios.js @@ -0,0 +1,8 @@ +import axios from "axios"; + +axios.defaults.baseURL = "http://localhost:8000/api"; +axios.defaults.timeout = 10000; +axios.defaults.headers["Content-Type"] = "application/json"; +axios.defaults.headers["Accept"] = "application/json"; + +export default axios; From fb97601f1af2125b7f75ca613d3defd4addeee37 Mon Sep 17 00:00:00 2001 From: Ana Elisa Ramos Date: Sat, 30 Nov 2024 16:58:28 -0300 Subject: [PATCH 07/14] =?UTF-8?q?feat(back):=20configura=C3=A7=C3=A3o=20da?= =?UTF-8?q?=20integra=C3=A7=C3=A3o=20com=20o=20front=20na=20parte=20do=20b?= =?UTF-8?q?ack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adiciona instalação do cors no back, e configura o projeto para receber requisições da porta 5173 (do front) Ref #83 --- API/AcheiUnB/settings.py | 6 ++++++ API/requirements.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/API/AcheiUnB/settings.py b/API/AcheiUnB/settings.py index bd286a41..68eea761 100644 --- a/API/AcheiUnB/settings.py +++ b/API/AcheiUnB/settings.py @@ -46,9 +46,11 @@ "allauth.socialaccount.providers.microsoft", "users", "django_extensions", + "corsheaders" ] MIDDLEWARE = [ + "corsheaders.middleware.CorsMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", @@ -179,3 +181,7 @@ LOGOUT_REDIRECT_URL = "/login/" MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage" LANGUAGE_CODE = "pt-br" + +CORS_ALLOWED_ORIGINS = [ + 'http://localhost:5173', +] diff --git a/API/requirements.txt b/API/requirements.txt index 0c39a1de..4bf586af 100644 --- a/API/requirements.txt +++ b/API/requirements.txt @@ -12,4 +12,5 @@ urllib3==2.2.3 Pillow djangorestframework django-extensions -djangorestframework-simplejwt \ No newline at end of file +djangorestframework-simplejwt +django-cors-headers==4.6.0 \ No newline at end of file From 71f50e4c96eb06d63de6734a2cd4744fbae24632 Mon Sep 17 00:00:00 2001 From: TiagoBalieiro Date: Sun, 1 Dec 2024 23:22:30 -0300 Subject: [PATCH 08/14] =?UTF-8?q?Interga=C3=A7=C3=A3o=20da=20tela=20de=20L?= =?UTF-8?q?ogin=20com=20o=20backend.=20Ao=20clicar=20no=20bot=C3=A3o=20o?= =?UTF-8?q?=20usu=C3=A1rio=20=C3=A9=20redirecionado=20para=20o=20endpoint?= =?UTF-8?q?=20de=20login=20com=20a=20microsoft.=20Para=20testar=20em=20des?= =?UTF-8?q?envolvimento=20=C3=A9=20necess=C3=A1rio=20rodar=20o=20backend?= =?UTF-8?q?=20na=20pasta=20API=20com=20o=20comando=20'sudo=20docker=20comp?= =?UTF-8?q?ose=20up=20--build'=20e=20o=20front=20na=20pasta=20web=20com=20?= =?UTF-8?q?o=20comando=20'npm=20run=20dev'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/Login.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index ac493f11..150d2190 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -10,7 +10,9 @@
- @@ -19,7 +21,9 @@