Commit 5c1ac261 by 李伟康

fix(auth): 修复重新登录功能

- 修改 store.dispatch 调用以传递 relogin 参数
- 移除 settings 页面的 noAuth 元数据配置
- 更新 navigation action 参数命名以提高清晰度
- 添加重新登录时的加载状态显示
- 实现重新登录时调用 login action 的逻辑
- 调整用户信息验证条件以支持 sessionId 验证
1 parent f104ae25
...@@ -50,7 +50,7 @@ fetchConfig(!isMock).then(res => { ...@@ -50,7 +50,7 @@ fetchConfig(!isMock).then(res => {
window.reLogin = () => { window.reLogin = () => {
util.removeLocalStorage('ww_userInfo') util.removeLocalStorage('ww_userInfo')
util.clearSessionId() util.clearSessionId()
store.dispatch('navigation') store.dispatch('navigation', true)
} }
window.vm = new Vue({ window.vm = new Vue({
el: '#app', el: '#app',
......
...@@ -2,9 +2,6 @@ export const mobilePages = { ...@@ -2,9 +2,6 @@ export const mobilePages = {
mobile: [ mobile: [
{ {
name: 'settings', name: 'settings',
meta: {
noAuth: true,
}
}, },
{ {
name: 'report', name: 'report',
......
...@@ -83,7 +83,7 @@ const actions = { ...@@ -83,7 +83,7 @@ const actions = {
if (error) Notify(typeof error === 'string' ? error : error.toString()) if (error) Notify(typeof error === 'string' ? error : error.toString())
} }
}, },
navigation ({ dispatch }, to) { navigation ({ dispatch }, isReLogin) {
let { corpId, sessionId } = getParams(), let { corpId, sessionId } = getParams(),
userInfo = util.getLocalStorage('ww_userInfo') userInfo = util.getLocalStorage('ww_userInfo')
dispatch('registerHttp', sessionId || '') dispatch('registerHttp', sessionId || '')
...@@ -92,7 +92,12 @@ const actions = { ...@@ -92,7 +92,12 @@ const actions = {
ww_storage_info.corpId = corpId ww_storage_info.corpId = corpId
util.setLocalStorage('ww_storage_info', ww_storage_info) util.setLocalStorage('ww_storage_info', ww_storage_info)
} }
if (userInfo) { if (isReLogin) {
util.showLoading()
dispatch('login')
return
}
if (userInfo || sessionId) {
state.showWindow = true state.showWindow = true
} else { } else {
util.showLoading() util.showLoading()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!