From 72d330e6dbc1712c05930a9dc02169dc7f4af820 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Fri, 19 May 2023 11:58:56 +0100 Subject: [PATCH 1/7] User profile page --- src/router/index.js | 8 ++++ src/views/LandingPages/Profile/Profile.vue | 43 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/views/LandingPages/Profile/Profile.vue diff --git a/src/router/index.js b/src/router/index.js index 51cb27e..c802d1d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -24,6 +24,7 @@ import ElProgressBars from "../layouts/sections/elements/progress-bars/ProgressB import ElToggles from "../layouts/sections/elements/toggles/TogglesView.vue"; import ElTypography from "../layouts/sections/elements/typography/TypographyView.vue"; import Project from "../views/LandingPages/Project/Project.vue"; +import Profile from "../views/LandingPages/Profile/Profile.vue"; const router = createRouter({ @@ -34,12 +35,19 @@ const router = createRouter({ name: "presentation", component: PresentationView, }, + { path: '/project/:id', name: 'project', component: Project }, + { + path: '/profile/:id', + name: 'profile', + component: Profile + }, + { path: "/pages/landing-pages/about-us", name: "about", diff --git a/src/views/LandingPages/Profile/Profile.vue b/src/views/LandingPages/Profile/Profile.vue new file mode 100644 index 0000000..bd4abc6 --- /dev/null +++ b/src/views/LandingPages/Profile/Profile.vue @@ -0,0 +1,43 @@ + + + + + + + + + \ No newline at end of file From 48c4df099dbaf71e2754990ea2cabfaee58919d2 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Fri, 19 May 2023 12:24:41 +0100 Subject: [PATCH 2/7] =?UTF-8?q?=D0=A1=D0=A1=D1=8B=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Presentation/Sections/PresentationSearch.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/Presentation/Sections/PresentationSearch.vue b/src/views/Presentation/Sections/PresentationSearch.vue index e31b42c..012ada6 100644 --- a/src/views/Presentation/Sections/PresentationSearch.vue +++ b/src/views/Presentation/Sections/PresentationSearch.vue @@ -34,13 +34,16 @@ const search = async () => {

Найдено проектов: {{ searchResultProjects.length}}

-

{{ project.title }}

+

{{ project.title }} with ID {{ project.id }}

{{ project.description }}

+ Страница проекта +

Найдено людей: {{ searchResultUsers.length}}

-

{{ user.username }}

+

{{ user.username }} with id {{ user.id }}

{{ user.email }}

+ Страница пользователя
From bdcbdf818e9fbc8f3f072b0253b93731de61c7ab Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Fri, 19 May 2023 13:48:13 +0100 Subject: [PATCH 3/7] Start of working auth --- .../LandingPages/SignIn/BasicView Old.vue | 171 ++++++++++++++ src/views/LandingPages/SignIn/BasicView.vue | 208 ++++++++---------- 2 files changed, 267 insertions(+), 112 deletions(-) create mode 100644 src/views/LandingPages/SignIn/BasicView Old.vue diff --git a/src/views/LandingPages/SignIn/BasicView Old.vue b/src/views/LandingPages/SignIn/BasicView Old.vue new file mode 100644 index 0000000..868347b --- /dev/null +++ b/src/views/LandingPages/SignIn/BasicView Old.vue @@ -0,0 +1,171 @@ + + diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index 868347b..13f37ec 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -1,21 +1,79 @@ + + + + From 4b9f81c4844906ed2b67eefae4d577175d75f26c Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Fri, 19 May 2023 14:11:50 +0100 Subject: [PATCH 4/7] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B0=D1=83=D1=82=D0=B5=D0=BD=D1=82=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D1=8F=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=20=D0=B6=D0=BE=D0=BF=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/LandingPages/SignIn/BasicView.vue | 22 ++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index 13f37ec..8a29f19 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -2,6 +2,7 @@ import { onMounted } from "vue"; import { ref } from "vue"; import axios from 'axios'; +import { computed } from "vue"; // example components import DefaultNavbar from "@/examples/navbars/NavbarDefault.vue"; @@ -14,6 +15,8 @@ const username = ref(''); const password = ref(''); const errorMessage = ref(''); +const isAuthenticated = computed(() => !!sessionStorage.getItem('access_token')); // Computed property to check if the user is authenticated + const login = async () => { if (!username.value || !password.value) { @@ -27,9 +30,11 @@ const login = async () => { username: username.value, password: password.value, }; + try { const response = await axios.post(url, body, { headers }); errorMessage.value = `Request:\nPOST ${url}\nHeaders: ${JSON.stringify(headers)}\nBody: ${JSON.stringify(body)}\n\nResponse:\nStatus: ${response.status}\nHeaders: ${JSON.stringify(response.headers)}\nBody: ${JSON.stringify(response.data)}`; + sessionStorage.setItem('access_token', response.data.access); // Save the access token in sessionStorage (new line) } catch (error) { if (error.response) { // The request was made and the server responded with a status code that falls out of the range of 2xx @@ -45,6 +50,10 @@ const login = async () => { } }; +const logout = () => { // Method to logout the user by clearing the session storage (new function) + sessionStorage.removeItem('access_token'); +}; + onMounted(() => { setMaterialInput(); @@ -106,6 +115,15 @@ export default {
+
+ +

Опять Ты!

+
+ +
+ +

Я вас не знаю, идите нафиг

+
@@ -124,6 +142,7 @@ export default { > Войти +
@@ -132,10 +151,7 @@ export default {
- - -

Нет аккаунта? Date: Fri, 19 May 2023 14:35:04 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B0=D1=83=D1=82=D0=B5=D0=BD=D1=82=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BD=D0=B0=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BD=D1=8B=D1=85=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D0=B0=D1=85,=20=D0=BD=D0=BE=20=D0=BD=D0=B5=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BE=D1=81=D0=B5=D0=B4=D0=BD=D0=B8=D1=85=20=D0=B2=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/LandingPages/SignIn/BasicView.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index 8a29f19..56163cb 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -122,8 +122,10 @@ export default {

+

Ты с какого района?

+ + +
@@ -142,6 +144,8 @@ export default { > Войти + +
From 6f725217e2aeab61ac85320bb620dfbcdda63f6a Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Fri, 19 May 2023 14:35:08 +0100 Subject: [PATCH 6/7] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B0=D1=83=D1=82=D0=B5=D0=BD=D1=82=D0=B8=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D1=8F,=20=D0=BD=D0=BE=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D0=BE=D0=B9=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Presentation/PresentationView.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/views/Presentation/PresentationView.vue b/src/views/Presentation/PresentationView.vue index fdaca58..c8c55d4 100644 --- a/src/views/Presentation/PresentationView.vue +++ b/src/views/Presentation/PresentationView.vue @@ -14,7 +14,7 @@ + + + + + \ No newline at end of file diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index 56163cb..9b85c21 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -118,6 +118,7 @@ export default {

Опять Ты!

+
@@ -146,7 +147,7 @@ export default {
- +