From e630c07d924a106511d1a1222aa2370ffb5b45c6 Mon Sep 17 00:00:00 2001 From: MojtabaSoumi Date: Sat, 7 Feb 2026 14:02:29 +0330 Subject: [PATCH] 1404/11/18-delete required rule in referral code & hidden home page --- src/main.ts | 6 +- src/views/base/index.vue | 10 +++- src/views/base/user/index.vue | 64 +++++++++++++++++++++- src/views/login/components/Login.vue | 4 +- src/views/login/components/PhoneVerify.vue | 2 +- 5 files changed, 76 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index 86847a1..7fc31a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -73,8 +73,8 @@ function goToLogin(to: RouteLocationNormalized, next: NavigationGuardNext) { } function goToHome(to: RouteLocationNormalized, next: NavigationGuardNext) { - if (to.name !== 'home') { - return next({ name: 'home' }) // Redirect to login + if (to.name !== 'buyProduct') { + return next({ name: 'buyProduct' }) // Redirect to login } else { return next() // If already on the login page, don't redirect } @@ -151,7 +151,7 @@ router.beforeEach(async (to, from, next) => { if (fingerPosition) { if (getToken()) { if (to.name === 'login') { - return next({ name: from.name || 'home' }) // Redirect to home if trying to access login after authentication + return next({ name: from.name || 'buyProduct' }) // Redirect to home if trying to access login after authentication } return next() // Proceed to the intended route } else { diff --git a/src/views/base/index.vue b/src/views/base/index.vue index 4d3752e..ee80b52 100644 --- a/src/views/base/index.vue +++ b/src/views/base/index.vue @@ -100,9 +100,13 @@
-
- -
صفحه اصلی
+ + + + +
+ +
فروشگاه
diff --git a/src/views/base/user/index.vue b/src/views/base/user/index.vue index 19083df..951406b 100644 --- a/src/views/base/user/index.vue +++ b/src/views/base/user/index.vue @@ -163,10 +163,49 @@
کسب درآمد
+ +
+ +
خروج از حساب کاربری
+
+
+ + + + + +
ویرایش اطلاعات
@@ -257,7 +296,7 @@ import { onMounted, reactive, ref, computed } from 'vue' import img from '@/assets/img/user_ly1.svg' import gr_bottom from './assets/img/gr_bottom_white.svg' -import { loading } from '@/utils' +import {loading, removeToken} from '@/utils' import BasicButton from '@/components/BasicPacks/BasicButton.vue' import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue' import { @@ -277,6 +316,11 @@ import { message } from 'ant-design-vue' import { updateMe, updatePass } from '@/api/me' import { useUserStore } from '@/store/userStore' import BaseDatePicker from '@/components/BasicPacks/BaseDatePicker' +import {DotLottieVue} from "@lottiefiles/dotlottie-vue"; +import DialogVant from "@/components/DialogVant.vue"; +import {useWalletStore} from "@/store/walletStore"; +import Icon from "@/components/BasicPacks/BasicIcon.vue"; +import {useWindowScroll} from "@vueuse/core/index"; const userFormState = ref({ fname: '', lname: '', @@ -291,11 +335,29 @@ const userPassForm = ref({ const formRef = ref() const formPassRef = ref() const userStore = useUserStore() +const showLogoutConfirm = ref() +const walletStore=useWalletStore() +const logoutLoading = ref(false) +const { x, y } = useWindowScroll() // const editPassVisible = ref(false) const editPassVisible = ref(false) const editPasswordVisible = ref(false) +async function logout() { + logoutLoading.value = true + // baseConfirm('آیا از حساب کاربری خارج می شوید؟',async () => { + userStore.userInfo = undefined + walletStore.walletInfo = undefined + /* userStore.$reset() + walletStore.$reset()*/ + removeToken() + await router.push({ name: 'login' }) + logoutLoading.value = true + window.location.reload() + // console.log('salam') + // }) +} function setForm() { userFormState.value = userStore.userInfo } diff --git a/src/views/login/components/Login.vue b/src/views/login/components/Login.vue index cbd8ae5..cc72b85 100644 --- a/src/views/login/components/Login.vue +++ b/src/views/login/components/Login.vue @@ -203,7 +203,7 @@ async function enterFingerPrint() { const fingerPrint = await authenticateWithFingerprint() if (fingerPrint) { setTruth() - await router.push({ name: 'home' }) + await router.push({ name: 'buyProduct' }) } else { message.error('خطا در اعتبارسنجی') } @@ -234,7 +234,7 @@ async function login(accessToken: string | undefined) { /* if (userStore.userInfo?.type === (URLUserType() === 'customer' ? 1 : 2)) {*/ await walletStore.getMyWallet() setTruth() - await router.push({ name: 'home' }) + await router.push({ name: 'buyProduct' }) /* } else { removeToken() userStore.removeInformation() diff --git a/src/views/login/components/PhoneVerify.vue b/src/views/login/components/PhoneVerify.vue index d2ab182..0914a2d 100644 --- a/src/views/login/components/PhoneVerify.vue +++ b/src/views/login/components/PhoneVerify.vue @@ -43,7 +43,7 @@ const userFormState = ref({ }) function phoneVerification() { - router.push({name: 'home' }) + router.push({name: 'buyProduct' }) }