fix
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { useGenerateStore } from '@/stores/modules/generate'
|
||||
const VerifyIDs = (num: number) => {
|
||||
const ids = [
|
||||
!!useGenerateStore().customerId,
|
||||
!!useGenerateStore().visitRecordId,
|
||||
!!useGenerateStore().styleId,
|
||||
// !!useGenerateStore().modelPhotoId,
|
||||
true,
|
||||
!!useGenerateStore().originalTryOnId,
|
||||
];
|
||||
return ids.splice(0, num).every(id => id) ? true : "/stylist/customer";
|
||||
}
|
||||
|
||||
/**
|
||||
* 路由缓存机制:
|
||||
@@ -22,17 +33,6 @@ import { useGenerateStore } from '@/stores/modules/generate'
|
||||
* 5. 原始试穿id-优先AI魔改
|
||||
* @returns boolean
|
||||
*/
|
||||
const VerifyIDs = (num: number) => {
|
||||
const ids = [
|
||||
!!useGenerateStore().customerId,
|
||||
!!useGenerateStore().visitRecordId,
|
||||
!!useGenerateStore().styleId,
|
||||
// !!useGenerateStore().modelPhotoId,
|
||||
true,
|
||||
!!useGenerateStore().originalTryOnId,
|
||||
];
|
||||
return ids.splice(0, num).every(id => id) ? true : "/stylist/customer";
|
||||
}
|
||||
const router = createRouter({
|
||||
history: createWebHistory('/'),
|
||||
// history: createWebHistory(import.meta.env.VITE_APP_URL),
|
||||
|
||||
@@ -7,7 +7,7 @@ console.log(whiteList)
|
||||
router.beforeEach((to, from, next) => {
|
||||
const verify = to.meta?.verify;
|
||||
if (typeof verify === 'function') {
|
||||
let res = verify()
|
||||
const res = verify()
|
||||
if (res === false) {
|
||||
return next(false)
|
||||
} else if (typeof res === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user