[Update] 添加用户首次登录页面重定向判断逻辑

This commit is contained in:
Bai
2020-06-03 19:56:46 +08:00
parent 486f7e2675
commit 4516f450fe
3 changed files with 14 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = '/rpc'
VUE_APP_BASE_API = ''
VUE_APP_PUBLIC_PATH = '/ui/'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@@ -6,6 +6,7 @@
:initial="object"
:url="url"
:update-success-next-route="updateSuccessNextRoute"
:clean-form-value="cleanFormValue"
:get-method="getMethod"
/>
</IBox>
@@ -67,7 +68,11 @@ export default {
helpText: this.$t('users.HelpText.MFAOfUserFirstLoginUserGuidePage')
}
},
updateSuccessNextRoute: { name: 'UserGuide' }
updateSuccessNextRoute: { name: 'UserGuide' },
cleanFormValue(value) {
value = Object.assign({}, value, { is_first_login: false })
return value
}
}
},
methods: {

View File

@@ -78,6 +78,12 @@ export async function getUserRoleAndSetRoutes({ to, from, next }) {
}
}
export async function checkUserFirstLogin({ to, from, next }) {
if (store.state.users.profile.is_first_login) {
next('/users/first-login/personal-information-improvement/')
}
}
export async function startup({ to, from, next }) {
if (initial) {
console.debug('Has initial')
@@ -90,6 +96,7 @@ export async function startup({ to, from, next }) {
await checkLogin({ to, from, next })
await getPublicSetting({ to, from, next })
await getUserRoleAndSetRoutes({ to, from, next })
await checkUserFirstLogin({ to, from, next })
return true
}