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/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 @@
-
-
-
-
-
-
-
Be the first to see the news
-
- Your company may not be in the software business, but eventually, a
- software company will be in your business.
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
- The Executive Team
-
-
- There’s nothing I really wanted to do in life that I wasn’t able to
- get good at. That’s my skill.
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
Contact Information
-
- Fill up the form and our Team will get back to you within
- 24 hours.
-
-
-
-
-
-
- (+40) 772 100 200
-
-
-
-
-
-
-
- hello@creative-tim.com
-
-
-
-
-
-
-
- Dyonisie Wolf Bucharest, RO 010458
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
Check my latest blogposts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
-
-
Michael Roven
-
- Follow
-
-
-
-
- 323
- Posts
-
-
- 3.5k
- Followers
-
-
- 260
- Following
-
-
-
- Decisions: If you can’t decide, the answer is no. If two equally
- difficult paths, choose the one more painful in the short term
- (pain avoidance is creating an illusion of equality). Choose the
- path that leaves you more equanimous.
- More about me
-
-
-
-
-
-
-
-
-
-
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/Profile/EditProfile.vue b/src/views/LandingPages/Profile/EditProfile.vue
index 5bcb312..afc31d3 100644
--- a/src/views/LandingPages/Profile/EditProfile.vue
+++ b/src/views/LandingPages/Profile/EditProfile.vue
@@ -80,11 +80,14 @@ 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');
+ router.push('/ViewMyProfile');
} catch (error) {
debugText.value = `Error: ${JSON.stringify(error, null, 2)}`;
console.error(error);
@@ -104,20 +107,28 @@ onMounted(async() => {
diff --git a/src/views/LandingPages/Project/EditProject.vue b/src/views/LandingPages/Project/EditProject.vue
index 5998b39..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;
@@ -45,18 +39,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 {
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/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
};
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 @@
-
-
-
-
- {{ typeof icon == "string" ? icon : icon.component }}
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ title }}
-
- {{ subtitle }}
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
Boost creativity
-
With our coded pages
-
- The easiest way to get started is to use one of our
- pre-built example pages.
-
-
-
-
-
-
-
-
-
-
-
- Presentation Pages for Company, Landing Pages, Blogs and Support
-
-
- These is just a small selection of the multiple possibitilies you
- have. Focus on the business, not on the design.
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
Pricing
-
Ready to get Material Kit?
-
- Based on the license you get, you will have direct access to our
- team
- of developers who built the product.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Secured Payment by
- 2Checkout with:
-
-
-
-
-
-
- Info: If you are a Registered Company inside the European
- Union you will be able to add your VAT ID after your Press "Buy
- Now"
-
-
-
-
-
-
-