| | |
| | | import store from '@/store'
|
| | | import router from '@/router'
|
| | | import { MessageBox, } from 'element-ui'
|
| | | import { login, logout, getInfo, refreshToken } from '@/api/login'
|
| | |
| | | commit('SET_TOKEN', data.access_token)
|
| | | setExpiresIn(data.expires_in)
|
| | | commit('SET_EXPIRES_IN', data.expires_in)
|
| | | store.dispatch('lock/unlockScreen')
|
| | | resolve()
|
| | | }).catch(error => {
|
| | | reject(error)
|
| | |
| | | router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
|
| | | }).catch(() => {})
|
| | | }
|
| | | /* 过期密码提示 */
|
| | | if(!res.isDefaultModifyPwd && res.isPasswordExpired) {
|
| | | MessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
| | | router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } })
|
| | | }).catch(() => {})
|
| | | }
|
| | | resolve(res)
|
| | | }).catch(error => {
|
| | | reject(error)
|