fix(user): drop the KYC route lock so every menu stays open
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# یادداشتهای یادگیری — abshode-domain-lookup
|
||||
|
||||
- 2026-11-10 | قفل منو بعد از احراز | `setupRouter.ts` + `RequiredKycModal.vue` | گارد فقط home/user و مدال سراسری برداشته شد؛ احراز روی معامله/واریز/هدیه ماند
|
||||
- 2026-11-10 | مدال موفقیت ثبتنام خالی | `DialogVantOneButton.vue` | تم لاگین `color:#fff`؛ بدون teleport متن سفید روی دیالوگ سفید — مثل `DialogVant` با teleport+رنگ تیره
|
||||
- 2026-11-10 | خانه خالی بدون KYC | `RequiredKycModal` + `HomeLayoutRenderer` | v-model:open روی computed فقطخواندنی؛ تشخیص احراز با `isCustomerIdentityVerified`؛ skeleton هنگام lazy layout
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import { useAuthStore } from '@/store/useAuthStore'
|
||||
import { recoverMobileViewportAfterAuth } from '@/layouts/composables/useMobileScrollReset'
|
||||
import { getFingerPosition, setFingerPosition } from '@/app/authBoot'
|
||||
import { isGuestHomeQuery } from '@/utils/guestHome'
|
||||
import { isCustomerIdentityVerified } from '@/utils/customerIdentity'
|
||||
import type { RouteLocationNormalized } from 'vue-router'
|
||||
|
||||
const PUBLIC_ROUTE_NAMES = ['login', '404', 'educate', 'aboutUs', 'aboutSoftware', 'tvMonitor'] as const
|
||||
@@ -83,17 +82,6 @@ export function setupRouterGuards() {
|
||||
return goToLogin(next)
|
||||
}
|
||||
|
||||
// کاربر احراز هویت نشده نباید بتواند به صفحات داخلی به جز پروفایل و خانه دسترسی پیدا کند
|
||||
if (
|
||||
userStore.userInfo &&
|
||||
!isCustomerIdentityVerified(userStore.userInfo.is_legal) &&
|
||||
!isPublicRoute(to) &&
|
||||
to.name !== 'home' &&
|
||||
to.name !== 'user'
|
||||
) {
|
||||
return goToHome(next)
|
||||
}
|
||||
|
||||
if (to.name === 'notifyTrigger') {
|
||||
const { useSettingsStore } = await import('@/store/settingsStore')
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useRouter } from 'vue-router'
|
||||
import BasicModal from '@/components/BasicPacks/BasicModal.vue'
|
||||
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
|
||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
@@ -69,9 +69,7 @@ import { useUserStore } from '@/store/userStore'
|
||||
import { getToken } from '@/utils'
|
||||
import { performUserLogout } from '@/utils/authSession'
|
||||
import { useDesktopBreakpoint } from '@/layouts/composables/useAppLayout'
|
||||
import { isCustomerIdentityVerified } from '@/utils/customerIdentity'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const isDesktop = useDesktopBreakpoint()
|
||||
@@ -79,18 +77,8 @@ const isDesktop = useDesktopBreakpoint()
|
||||
const modalWidth = computed(() => (isDesktop.value ? '420px' : '90vw'))
|
||||
|
||||
const isKycRequired = computed(() => {
|
||||
if (!getToken()) return false
|
||||
if (
|
||||
route.name === 'login' ||
|
||||
route.name === 'tvMonitor' ||
|
||||
route.name === 'aboutSoftware' ||
|
||||
route.name === 'user'
|
||||
) {
|
||||
return false
|
||||
}
|
||||
const info = userStore.userInfo
|
||||
if (!info) return false
|
||||
return !isCustomerIdentityVerified(info.is_legal)
|
||||
// قفل سراسری منو برداشته شد؛ احراز روی خود عملیات (معامله، واریز، هدیه) میماند.
|
||||
return false
|
||||
})
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user