From c6b9bc76440de4835b23f645d3ecd31d68d876a3 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 11:36:22 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=83=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/LandingPages/Project/EditProject.vue | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/views/LandingPages/Project/EditProject.vue b/src/views/LandingPages/Project/EditProject.vue index 5998b39..b1a1d4f 100644 --- a/src/views/LandingPages/Project/EditProject.vue +++ b/src/views/LandingPages/Project/EditProject.vue @@ -45,18 +45,7 @@ const getProject = async () => { } }; -// const updateProfile = async () => { -// try { -// const token = computed(() => sessionStorage.getItem('access_token')); -// debugText.value = `Type of token: ${typeof token.value}, Value of token: ${token.value}`; -// const headers = { 'Authorization': `Bearer ${token.value}` }; -// await axios.patch(`http://somebodyhire.me/api/profile/${userId.value}/`, profileData.value, { headers }); -// router.push('/ViewMyProfile'); -// } catch (error) { -// debugText.value = `Error: ${JSON.stringify(error, null, 2)}`; -// console.error(error); -// } -// }; + const updateProject = async () => { try { From 403fbeea011b066dc493e389993ee840eb4ebe22 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 11:36:24 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=83=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LandingPages/Profile/EditProfile.vue | 2 +- .../Components/BuiltByDevelopers.vue | 35 ------- .../Presentation/Components/ExampleCard.vue | 98 ------------------- 3 files changed, 1 insertion(+), 134 deletions(-) delete mode 100644 src/views/Presentation/Components/BuiltByDevelopers.vue delete mode 100644 src/views/Presentation/Components/ExampleCard.vue diff --git a/src/views/LandingPages/Profile/EditProfile.vue b/src/views/LandingPages/Profile/EditProfile.vue index 5bcb312..8199848 100644 --- a/src/views/LandingPages/Profile/EditProfile.vue +++ b/src/views/LandingPages/Profile/EditProfile.vue @@ -84,7 +84,7 @@ const updateProfile = async () => { formData.append('profile_image', selectedImage.value); await axios.patch(`http://somebodyhire.me/api/profile/${userId.value}/`, formData, { headers }); - // router.push('/ViewMyProfile'); + router.push('/ViewMyProfile'); } catch (error) { debugText.value = `Error: ${JSON.stringify(error, null, 2)}`; console.error(error); diff --git a/src/views/Presentation/Components/BuiltByDevelopers.vue b/src/views/Presentation/Components/BuiltByDevelopers.vue deleted file mode 100644 index 37c479b..0000000 --- a/src/views/Presentation/Components/BuiltByDevelopers.vue +++ /dev/null @@ -1,35 +0,0 @@ - - diff --git a/src/views/Presentation/Components/ExampleCard.vue b/src/views/Presentation/Components/ExampleCard.vue deleted file mode 100644 index ab95c4d..0000000 --- a/src/views/Presentation/Components/ExampleCard.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - From 1fa856605975beac32dff1e1ae37b22915254059 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 12:08:09 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B5=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/LandingPages/AboutUs/AboutView.vue | 104 ----------- .../AboutUs/Sections/AboutFeaturing.vue | 82 --------- .../AboutUs/Sections/AboutInformation.vue | 54 ------ .../AboutUs/Sections/AboutNewsletter.vue | 54 ------ .../AboutUs/Sections/AboutTeam.vue | 72 -------- src/views/LandingPages/Author/AuthorView.vue | 32 ---- .../Author/Sections/AuthorContact.vue | 172 ------------------ .../Author/Sections/AuthorFooter.vue | 88 --------- .../Author/Sections/AuthorPosts.vue | 52 ------ .../Author/Sections/AuthorProfile.vue | 82 --------- .../LandingPages/ContactUs/ContactView.vue | 123 ------------- .../LandingPages/SignIn/BasicView Old.vue | 171 ----------------- .../LandingPages/components/AboutUsOption.vue | 55 ------ .../Sections/PresentationInformation.vue | 70 ------- .../Sections/PresentationPages.vue | 80 -------- .../Sections/PresentationPricing.vue | 123 ------------- 16 files changed, 1414 deletions(-) delete mode 100644 src/views/LandingPages/AboutUs/AboutView.vue delete mode 100644 src/views/LandingPages/AboutUs/Sections/AboutFeaturing.vue delete mode 100644 src/views/LandingPages/AboutUs/Sections/AboutInformation.vue delete mode 100644 src/views/LandingPages/AboutUs/Sections/AboutNewsletter.vue delete mode 100644 src/views/LandingPages/AboutUs/Sections/AboutTeam.vue delete mode 100644 src/views/LandingPages/Author/AuthorView.vue delete mode 100644 src/views/LandingPages/Author/Sections/AuthorContact.vue delete mode 100644 src/views/LandingPages/Author/Sections/AuthorFooter.vue delete mode 100644 src/views/LandingPages/Author/Sections/AuthorPosts.vue delete mode 100644 src/views/LandingPages/Author/Sections/AuthorProfile.vue delete mode 100644 src/views/LandingPages/ContactUs/ContactView.vue delete mode 100644 src/views/LandingPages/SignIn/BasicView Old.vue delete mode 100644 src/views/LandingPages/components/AboutUsOption.vue delete mode 100644 src/views/Presentation/Sections/PresentationInformation.vue delete mode 100644 src/views/Presentation/Sections/PresentationPages.vue delete mode 100644 src/views/Presentation/Sections/PresentationPricing.vue diff --git a/src/views/LandingPages/AboutUs/AboutView.vue b/src/views/LandingPages/AboutUs/AboutView.vue deleted file mode 100644 index e5d1f66..0000000 --- a/src/views/LandingPages/AboutUs/AboutView.vue +++ /dev/null @@ -1,104 +0,0 @@ - - diff --git a/src/views/LandingPages/AboutUs/Sections/AboutFeaturing.vue b/src/views/LandingPages/AboutUs/Sections/AboutFeaturing.vue deleted file mode 100644 index 4917ff4..0000000 --- a/src/views/LandingPages/AboutUs/Sections/AboutFeaturing.vue +++ /dev/null @@ -1,82 +0,0 @@ - - diff --git a/src/views/LandingPages/AboutUs/Sections/AboutInformation.vue b/src/views/LandingPages/AboutUs/Sections/AboutInformation.vue deleted file mode 100644 index 8fe06b0..0000000 --- a/src/views/LandingPages/AboutUs/Sections/AboutInformation.vue +++ /dev/null @@ -1,54 +0,0 @@ - - diff --git a/src/views/LandingPages/AboutUs/Sections/AboutNewsletter.vue b/src/views/LandingPages/AboutUs/Sections/AboutNewsletter.vue deleted file mode 100644 index 45e714d..0000000 --- a/src/views/LandingPages/AboutUs/Sections/AboutNewsletter.vue +++ /dev/null @@ -1,54 +0,0 @@ - - diff --git a/src/views/LandingPages/AboutUs/Sections/AboutTeam.vue b/src/views/LandingPages/AboutUs/Sections/AboutTeam.vue deleted file mode 100644 index ec311cc..0000000 --- a/src/views/LandingPages/AboutUs/Sections/AboutTeam.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/src/views/LandingPages/Author/AuthorView.vue b/src/views/LandingPages/Author/AuthorView.vue deleted file mode 100644 index 42cc82a..0000000 --- a/src/views/LandingPages/Author/AuthorView.vue +++ /dev/null @@ -1,32 +0,0 @@ - - diff --git a/src/views/LandingPages/Author/Sections/AuthorContact.vue b/src/views/LandingPages/Author/Sections/AuthorContact.vue deleted file mode 100644 index 28150de..0000000 --- a/src/views/LandingPages/Author/Sections/AuthorContact.vue +++ /dev/null @@ -1,172 +0,0 @@ - - diff --git a/src/views/LandingPages/Author/Sections/AuthorFooter.vue b/src/views/LandingPages/Author/Sections/AuthorFooter.vue deleted file mode 100644 index b619026..0000000 --- a/src/views/LandingPages/Author/Sections/AuthorFooter.vue +++ /dev/null @@ -1,88 +0,0 @@ - - diff --git a/src/views/LandingPages/Author/Sections/AuthorPosts.vue b/src/views/LandingPages/Author/Sections/AuthorPosts.vue deleted file mode 100644 index 748b90d..0000000 --- a/src/views/LandingPages/Author/Sections/AuthorPosts.vue +++ /dev/null @@ -1,52 +0,0 @@ - - diff --git a/src/views/LandingPages/Author/Sections/AuthorProfile.vue b/src/views/LandingPages/Author/Sections/AuthorProfile.vue deleted file mode 100644 index 30128e7..0000000 --- a/src/views/LandingPages/Author/Sections/AuthorProfile.vue +++ /dev/null @@ -1,82 +0,0 @@ - - diff --git a/src/views/LandingPages/ContactUs/ContactView.vue b/src/views/LandingPages/ContactUs/ContactView.vue deleted file mode 100644 index f8e30e5..0000000 --- a/src/views/LandingPages/ContactUs/ContactView.vue +++ /dev/null @@ -1,123 +0,0 @@ - - diff --git a/src/views/LandingPages/SignIn/BasicView Old.vue b/src/views/LandingPages/SignIn/BasicView Old.vue deleted file mode 100644 index 868347b..0000000 --- a/src/views/LandingPages/SignIn/BasicView Old.vue +++ /dev/null @@ -1,171 +0,0 @@ - - diff --git a/src/views/LandingPages/components/AboutUsOption.vue b/src/views/LandingPages/components/AboutUsOption.vue deleted file mode 100644 index e3ca972..0000000 --- a/src/views/LandingPages/components/AboutUsOption.vue +++ /dev/null @@ -1,55 +0,0 @@ - - diff --git a/src/views/Presentation/Sections/PresentationInformation.vue b/src/views/Presentation/Sections/PresentationInformation.vue deleted file mode 100644 index ba84929..0000000 --- a/src/views/Presentation/Sections/PresentationInformation.vue +++ /dev/null @@ -1,70 +0,0 @@ - - diff --git a/src/views/Presentation/Sections/PresentationPages.vue b/src/views/Presentation/Sections/PresentationPages.vue deleted file mode 100644 index cf6fd7b..0000000 --- a/src/views/Presentation/Sections/PresentationPages.vue +++ /dev/null @@ -1,80 +0,0 @@ - - diff --git a/src/views/Presentation/Sections/PresentationPricing.vue b/src/views/Presentation/Sections/PresentationPricing.vue deleted file mode 100644 index ab80c5a..0000000 --- a/src/views/Presentation/Sections/PresentationPricing.vue +++ /dev/null @@ -1,123 +0,0 @@ - - From a9c5affd27da5f9f9a9283506db3dc52b5a1c7de Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 12:18:25 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=20=D1=8D?= =?UTF-8?q?=D0=BA=D1=81=D0=BF=D0=BE=D1=80=D1=82=20=D0=BD=D0=B5=D0=BD=D1=83?= =?UTF-8?q?=D0=B6=D0=BD=D1=8B=D1=85=20=D1=81=D0=B5=D0=BA=D1=86=D0=B8=D0=B9?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 18 ------------------ src/views/LandingPages/SignIn/BasicView.vue | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 23e02c0..c531e24 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,5 @@ import { createRouter, createWebHistory } from "vue-router"; import PresentationView from "../views/Presentation/PresentationView.vue"; -import AboutView from "../views/LandingPages/AboutUs/AboutView.vue"; -import ContactView from "../views/LandingPages/ContactUs/ContactView.vue"; -import AuthorView from "../views/LandingPages/Author/AuthorView.vue"; import SignInBasicView from "../views/LandingPages/SignIn/BasicView.vue"; import Project from "../views/LandingPages/Project/Project.vue"; import Profile from "../views/LandingPages/Profile/Profile.vue"; @@ -99,21 +96,6 @@ const router = createRouter({ component: ForgotPassword, }, - { - path: "/pages/landing-pages/about-us", - name: "about", - component: AboutView, - }, - { - path: "/pages/landing-pages/contact-us", - name: "contactus", - component: ContactView, - }, - { - path: "/pages/landing-pages/author", - name: "author", - component: AuthorView, - }, { path: "/pages/landing-pages/basic", name: "signin-basic", diff --git a/src/views/LandingPages/SignIn/BasicView.vue b/src/views/LandingPages/SignIn/BasicView.vue index d7f7b07..1ac6717 100644 --- a/src/views/LandingPages/SignIn/BasicView.vue +++ b/src/views/LandingPages/SignIn/BasicView.vue @@ -22,6 +22,13 @@ const loggedUserName = computed(() => sessionStorage.getItem('username')); const isStaff = computed(() => sessionStorage.getItem('is_staff')); const token = computed(() => sessionStorage.getItem('token')); +//Тут мы попробуем использовать local storage потому что оно должно работать между вкладками +const isAuthenticatedLocal = computed(() => !!localStorage.getItem('access_token')); +const userIdLocal = computed(() => localStorage.getItem('user_id')); +const loggedUserNameLocal = computed(() => localStorage.getItem('username')); +const isStaffLocal = computed(() => localStorage.getItem('is_staff')); +const tokenLocal = computed(() => localStorage.getItem('token')); + const login = async () => { if (!username.value || !password.value) { errorMessage.value = "Please fill in both fields."; @@ -42,6 +49,13 @@ const login = async () => { sessionStorage.setItem('user_id', response.data.id); sessionStorage.setItem('is_staff', response.data.is_staff); sessionStorage.setItem('token', response.data.token); + //Дублируем всё, потому что страницы будут переползать постепенно + localStorage.setItem('access_token', response.data.access); + localStorage.setItem('username', username.value); + localStorage.setItem('user_id', response.data.id); + localStorage.setItem('is_staff', response.data.is_staff); + localStorage.setItem('token', response.data.token); + location.reload(); // Refresh page } catch (error) { if (error.response) { @@ -61,6 +75,13 @@ const logout = () => { sessionStorage.removeItem('user_id'); sessionStorage.setItem('is_staff', false); sessionStorage.removeItem('token'); + //и тут тоже не забываем продублировать + localStorage.removeItem('access_token'); + localStorage.removeItem('username'); // Also clear the username from sessionStorage + localStorage.removeItem('user_id'); + localStorage.setItem('is_staff', false); + localStorage.removeItem('token'); + location.reload(); // Refresh page after logout }; From 87963ba0cc6c017a2df028d563eb61dba19335f6 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 12:48:15 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=D0=9D=D0=BE=D1=80=D0=BC=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?,=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B1=D1=83=D0=BA=D0=B2=D1=8B,=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/LandingPages/Project/EditProject.vue | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/views/LandingPages/Project/EditProject.vue b/src/views/LandingPages/Project/EditProject.vue index b1a1d4f..797ac9a 100644 --- a/src/views/LandingPages/Project/EditProject.vue +++ b/src/views/LandingPages/Project/EditProject.vue @@ -17,12 +17,6 @@ const projectId = ref(null); const route = useRoute(); -// const getProfile = async () => { -// const profileDataRecieved = await axios.get(`http://somebodyhire.me/api/profile/${userId.value}/`); -// profileData.value = processProfileData(profileDataRecieved.data); -// }; - - axios.interceptors.request.use((request) => { debugText.value += '\n\nRequest:\n' + JSON.stringify(request, null, 2); return request; From 5e914a99bfab6984776b8edcc6565747d1debbb6 Mon Sep 17 00:00:00 2001 From: FEARmeR Date: Tue, 23 May 2023 12:49:17 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=D0=94=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BC?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=D1=81=D1=8F=20=D1=82=D1=8B=20=D1=83=D0=B6?= =?UTF-8?q?=D0=B5!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LandingPages/Profile/EditProfile.vue | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/views/LandingPages/Profile/EditProfile.vue b/src/views/LandingPages/Profile/EditProfile.vue index 8199848..afc31d3 100644 --- a/src/views/LandingPages/Profile/EditProfile.vue +++ b/src/views/LandingPages/Profile/EditProfile.vue @@ -80,8 +80,11 @@ const updateProfile = async () => { formData.append(key, value); }); - // Append the image file - formData.append('profile_image', selectedImage.value); + + if (selectedImage.value) { + formData.append('profile_image', selectedImage.value); + }; + await axios.patch(`http://somebodyhire.me/api/profile/${userId.value}/`, formData, { headers }); router.push('/ViewMyProfile'); @@ -104,20 +107,28 @@ onMounted(async() => {

User Profile: {{ loggedUserName }}

- + + + - + + - - - - - - - - - - + + + + + + + + + +
+ + +