Commit dfd27b57 authored by Facius's avatar Facius

feat: 自动登录之后首页刷新

parent 393e866b
Pipeline #6651 canceled with stages
...@@ -282,6 +282,10 @@ export default { ...@@ -282,6 +282,10 @@ export default {
this.initInfo(); this.initInfo();
}, 1500); }, 1500);
}); });
uni.$on('login-success', res => {
this.initInfo();
});
this.systemInfo = uni.getSystemInfoSync(); this.systemInfo = uni.getSystemInfoSync();
}, },
onShow() { onShow() {
...@@ -303,6 +307,7 @@ export default { ...@@ -303,6 +307,7 @@ export default {
}, },
onUnload() { onUnload() {
uni.$off('bill-list-reload'); uni.$off('bill-list-reload');
uni.$off('login-success');
}, },
methods: { methods: {
getShareUserId(q) { getShareUserId(q) {
......
...@@ -194,6 +194,7 @@ const actions = { ...@@ -194,6 +194,7 @@ const actions = {
} = res.data } = res.data
let timestamp=res.timestamp let timestamp=res.timestamp
setToken(token) setToken(token)
uni.$emit('login-success');
setRefreshToken(refreshToken) setRefreshToken(refreshToken)
dispatch("Set_auto_login",true) dispatch("Set_auto_login",true)
await dispatch('Get_UserInfo') await dispatch('Get_UserInfo')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment