diff --git a/src/locales/en.json b/src/locales/en.json index db4e1c6e8..05bf7860d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -38,6 +38,7 @@ "First name": "First name", "Generate packing slips": "Generate packing slips", "Go to OMS": "Go to OMS", + "Go to Launchpad": "Go to Launchpad", "Handover": "Handover", "Inactive store": "Inactive store", "in stock": "in stock", diff --git a/src/locales/es.json b/src/locales/es.json index ee3c762a5..c1a556ca1 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -38,6 +38,7 @@ "First name": "Nombre", "Generate packing slips": "Generar documentos de embalaje", "Go to OMS": "Ir a OMS", + "Go to Launchpad": "Go to Launchpad", "Handover": "Entregar", "Inactive store": "Tienda inactiva", "in stock": "en stock", diff --git a/src/locales/ja.json b/src/locales/ja.json index 74f2c2e93..054e31ba4 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -38,6 +38,7 @@ "First name": "名", "Generate packing slips": "内容明細票の作成", "Go to OMS": "OMSへ", + "Go to Launchpad": "Go to Launchpad", "Handover": "引き継ぐ", "Inactive store": "休止店舗", "in stock": "在庫あり", diff --git a/src/router/index.ts b/src/router/index.ts index 87a45c758..12db9085e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -34,6 +34,16 @@ const authGuard = async (to: any, from: any, next: any) => { next() }; +const loginGuard = (to: any, from: any, next: any) => { + const authStore = useAuthStore() + if (authStore.isAuthenticated) { + // if route has token and oms do the login flow processing + if (to.query?.token && to.query?.oms) next() + else next('/') + } + next(); +}; + const routes: Array = [ { path: '/', @@ -74,7 +84,8 @@ const routes: Array = [ { path: '/login', name: 'Login', - component: Login + component: Login, + beforeEnter: loginGuard }, { path: "/orderdetail/:orderId/:orderPartSeqId", diff --git a/src/views/Settings.vue b/src/views/Settings.vue index f570f1ba4..08ba0001d 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -13,12 +13,19 @@ - + + {{ userProfile?.userLoginId }} {{ userProfile?.partyName }} - {{ $t("Logout") }} + {{ $t("Logout") }} + + {{ $t("Go to Launchpad") }} + + @@ -290,9 +297,13 @@ export default defineComponent({ }, logout () { this.store.dispatch('user/logout').then(() => { - window.location.href = process.env.VUE_APP_LOGIN_URL as string + const redirectUrl = window.location.origin + '/login' + window.location.href = `${process.env.VUE_APP_LOGIN_URL}?isLoggedOut=true&redirectUrl=${redirectUrl}` }) }, + goToLaunchpad() { + window.location.href = `${process.env.VUE_APP_LOGIN_URL}` + }, setShowShippingOrdersPreference (ev: any) { this.store.dispatch('user/setUserPreference', { showShippingOrders: ev.detail.checked }) },