diff --git a/src/router/index.ts b/src/router/index.ts index 5e98295..2498bec 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -62,42 +62,17 @@ const router = createRouter({ name: 'WelcomePage', component: () => import('@/views/login/WelcomePage.vue') }, + { + path: '/customer', + name: 'customer', + component: () => import('@/views/login/customer.vue'), + }, { path: '/homeNav', name: 'HomeNav', component: () => import('@/views/Workshop/home.vue') }, - { - path: '/stylist', - name: 'StylistPage', - redirect: '/stylist/index', - component: () => import('@/views/stylist/container.vue'), - children: [ - { - path: 'index', - name: 'index', - component: () => import('@/views/stylist/index.vue'), - meta: { verify: ()=> VerifyIDs(2) } - }, - { - path: 'sex', - name: 'sex', - component: () => import('@/views/stylist/sex.vue'), - meta: { verify: ()=> VerifyIDs(2) } - }, - { - path: 'dressfor', - name: 'dressfor', - component: () => import('@/views/stylist/dressfor.vue'), - meta: { verify: ()=> VerifyIDs(2) } - }, - { - path: 'customer', - name: 'customer', - component: () => import('@/views/stylist/customer.vue'), - } - ] - }, + { path: '/asistant', name: 'asistant', @@ -109,10 +84,37 @@ const router = createRouter({ name: 'Workshop', component: () => import('../views/Workshop/index.vue'), children: [ - { - path: '/workshop', - redirect: '/workshop/selectStyle' - }, + // { + // path: '/workshop', + // redirect: '/workshop/selectStyle' + // }, + { + path: '/workshop/stylist', + name: 'StylistPage', + redirect: '/workshop/stylist/index', + component: () => import('@/views/stylist/container.vue'), + children: [ + { + path: 'index', + name: 'index', + component: () => import('@/views/stylist/index.vue'), + meta: { verify: ()=> VerifyIDs(2) } + }, + { + path: 'sex', + name: 'sex', + component: () => import('@/views/stylist/sex.vue'), + meta: { verify: ()=> VerifyIDs(2) } + }, + { + path: 'dressfor', + name: 'dressfor', + component: () => import('@/views/stylist/dressfor.vue'), + meta: { verify: ()=> VerifyIDs(2) } + }, + + ] + }, { path: '/workshop/selectStyle', name: 'SelectStyle', diff --git a/src/views/login/LoginPage.vue b/src/views/login/LoginPage.vue index 73de64a..2bfe9b4 100644 --- a/src/views/login/LoginPage.vue +++ b/src/views/login/LoginPage.vue @@ -118,7 +118,7 @@ const handleLogin = async () => { userInfoStore.setToken(response.token) userInfoStore.setUserInfo(response.user) showToast('login success') - router.replace('/stylist/customer') + router.replace('/customer') } ) } @@ -141,7 +141,7 @@ const handleGoogleLogin = async (accessToken: string) => { userInfoStore.setToken(result.token) userInfoStore.setUserInfo(result.user) showToast('Google login successful') - router.replace('/stylist/customer') + router.replace('/customer') } catch (error) { console.error('Google登录失败:', error) showToast('Google login failed, please try again') diff --git a/src/views/login/SignupPage.vue b/src/views/login/SignupPage.vue index 404a3c8..62bd270 100644 --- a/src/views/login/SignupPage.vue +++ b/src/views/login/SignupPage.vue @@ -142,7 +142,7 @@ const handleGoogleSignup = async (accessToken: string) => { userInfoStore.setToken(result.token) userInfoStore.setUserInfo(result.user) showToast('Google sign up successful') - router.replace('/stylist/customer') + router.replace('/customer') } catch (error) { console.error('Google注册失败:', error) showToast(error?.message || 'Google sign up failed, please try again') diff --git a/src/views/stylist/customer.vue b/src/views/login/customer.vue similarity index 99% rename from src/views/stylist/customer.vue rename to src/views/login/customer.vue index 3b563bf..f3f39dc 100644 --- a/src/views/stylist/customer.vue +++ b/src/views/login/customer.vue @@ -93,7 +93,7 @@ const handleConfirm = async () => { useUserInfoStore().resetGenerateParams() // console.log('res', res) generateStore.setCustomerInfo(res) - // router.push('/stylist/index') + // router.push('/workshop/stylist/index') router.push('/homeNav') }) } diff --git a/src/views/stylist/dressfor.vue b/src/views/stylist/dressfor.vue index 6e0fed9..d4c210b 100644 --- a/src/views/stylist/dressfor.vue +++ b/src/views/stylist/dressfor.vue @@ -1,5 +1,4 @@