mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-22 08:08:39 +00:00
[Update] 添加用户首次登录页面重定向判断逻辑
This commit is contained in:
@@ -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,
|
||||
|
@@ -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: {
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user