| | |
| | | const expireTime = current.setTime(current.getTime() + 1000 * data.expires_in) |
| | | this.$store.commit('account/setExpireTime', expireTime) |
| | | }, |
| | | getUserDetailInfo() { |
| | | this.$get('auth/user').then((r) => { |
| | | async getUserDetailInfo() { |
| | | try { |
| | | const r = await this.$get('auth/user') |
| | | this.$store.commit('account/setUser', r.data.principal) |
| | | // 预加载字典数据到缓存 |
| | | await this.$store.dispatch('dict/LoadAllDicts') |
| | | this.$message({ |
| | | message: this.$t('tips.loginSuccess'), |
| | | type: 'success' |
| | | }) |
| | | this.loading = false |
| | | this.$router.push('/') |
| | | }).catch((error) => { |
| | | } catch (error) { |
| | | this.$message({ |
| | | message: this.$t('tips.loginFail'), |
| | | type: 'error' |
| | | }) |
| | | console.error(error) |
| | | this.loading = false |
| | | }) |
| | | } |
| | | }, |
| | | loginSuccessCallback() { |
| | | this.$get('system/user/success').catch((e) => { console.log(e) }) |