This commit is contained in:
李志鹏
2025-10-31 14:41:40 +08:00
parent 1f8051a266
commit 9d9794c6b0
2 changed files with 12 additions and 12 deletions

View File

@@ -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),

View File

@@ -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') {