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 => {
window.reLogin = () => {
util.removeLocalStorage('ww_userInfo')
util.clearSessionId()
store.dispatch('navigation')
store.dispatch('navigation', true)
}
window.vm = new Vue({
el: '#app',
......
......@@ -2,9 +2,6 @@ export const mobilePages = {
mobile: [
{
name: 'settings',
meta: {
noAuth: true,
}
},
{
name: 'report',
......
......@@ -83,7 +83,7 @@ const actions = {
if (error) Notify(typeof error === 'string' ? error : error.toString())
}
},
navigation ({ dispatch }, to) {
navigation ({ dispatch }, isReLogin) {
let { corpId, sessionId } = getParams(),
userInfo = util.getLocalStorage('ww_userInfo')
dispatch('registerHttp', sessionId || '')
......@@ -92,7 +92,12 @@ const actions = {
ww_storage_info.corpId = corpId
util.setLocalStorage('ww_storage_info', ww_storage_info)
}
if (userInfo) {
if (isReLogin) {
util.showLoading()
dispatch('login')
return
}
if (userInfo || sessionId) {
state.showWindow = true
} else {
util.showLoading()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!