1405/05/15-change redirect route

This commit is contained in:
2026-08-06 11:54:35 +03:30
parent 46807e3089
commit 4361e71030
5 changed files with 203 additions and 188 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import {createRouter, createWebHistory} from 'vue-router'
import {isToken} from "@/utils";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -17,7 +18,7 @@ const router = createRouter({
{
path: `/`,
name: 'main',
redirect: {name: 'buyProduct'},
redirect: {name: isToken()?'home':'buyProduct'},
component: () => import('../views/base/index.vue'),
children: [
{
+2 -2
View File
@@ -198,7 +198,7 @@ async function enterFingerPrint() {
const fingerPrint = await authenticateWithFingerprint()
if (fingerPrint) {
setTruth()
await router.push({ name: 'buyProduct' })
await router.push({ name: 'home' })
} else {
message.error('خطا در اعتبارسنجی')
}
@@ -229,7 +229,7 @@ async function login(accessToken: string | undefined) {
/* if (userStore.userInfo?.type === (URLUserType() === 'customer' ? 1 : 2)) {*/
await walletStore.getMyWallet()
setTruth()
await router.push({ name: 'buyProduct' })
await router.push({ name: 'home' })
/* } else {
removeToken()
userStore.removeInformation()
+1 -1
View File
@@ -43,7 +43,7 @@ const userFormState = ref<UserMobile>({
})
function phoneVerification() {
router.push({name: 'buyProduct' })
router.push({name: 'home' })
}
</script>