CN-484 交互优化:登录拦截后,在登录成功后跳转原url
This commit is contained in:
@@ -77,7 +77,7 @@ export default {
|
|||||||
if (!this.$_.isEmpty(res.data.theme)) {
|
if (!this.$_.isEmpty(res.data.theme)) {
|
||||||
localStorage.setItem(storageKey.theme, res.data.theme)
|
localStorage.setItem(storageKey.theme, res.data.theme)
|
||||||
}
|
}
|
||||||
res.loginSuccessPath = this.loginSuccessPath
|
res.loginSuccessPath = this.loginSuccessPath ? this.loginSuccessPath : localStorage.getItem(storageKey.tokenExpireCurrentPath)
|
||||||
this.loginSuccess(res)
|
this.loginSuccess(res)
|
||||||
localStorage.setItem(storageKey.username, this.username)
|
localStorage.setItem(storageKey.username, this.username)
|
||||||
} else if (res.code === 518005) {
|
} else if (res.code === 518005) {
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ const loginWhiteList = ['/login', '/'] // 免登陆白名单
|
|||||||
const permissionWhiteList = [...loginWhiteList, '/entityDetail'] // 权限白名单
|
const permissionWhiteList = [...loginWhiteList, '/entityDetail'] // 权限白名单
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
|
if (to.path.indexOf('/login') == -1) {
|
||||||
|
localStorage.setItem(storageKey.tokenExpireCurrentPath, to.fullPath)
|
||||||
|
}
|
||||||
// 加载iso-3166-2资源
|
// 加载iso-3166-2资源
|
||||||
loadGeoData()
|
loadGeoData()
|
||||||
// 加载baseUrl
|
// 加载baseUrl
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ export const storageKey = {
|
|||||||
unsavedChange: 'cn-unsaved-change',
|
unsavedChange: 'cn-unsaved-change',
|
||||||
entitySearchHistory: 'cn-entity-search-history',
|
entitySearchHistory: 'cn-entity-search-history',
|
||||||
echartLegendFontSize: 'echartLegendFontSize',
|
echartLegendFontSize: 'echartLegendFontSize',
|
||||||
echartLabelFontSize: 'echartLabelFontSize'
|
echartLabelFontSize: 'echartLabelFontSize',
|
||||||
|
tokenExpireCurrentPath: 'token-expire-current-path'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 统一定义跳转来源
|
// 统一定义跳转来源
|
||||||
|
|||||||
Reference in New Issue
Block a user