新增锁定屏幕功能
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import store from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { MessageBox, } from 'element-ui'
|
import { MessageBox, } from 'element-ui'
|
||||||
import { login, logout, getInfo } from '@/api/login'
|
import { login, logout, getInfo } from '@/api/login'
|
||||||
@@ -51,6 +52,7 @@ const user = {
|
|||||||
login(username, password, code, uuid).then(res => {
|
login(username, password, code, uuid).then(res => {
|
||||||
setToken(res.token)
|
setToken(res.token)
|
||||||
commit('SET_TOKEN', res.token)
|
commit('SET_TOKEN', res.token)
|
||||||
|
store.dispatch('lock/unlockScreen')
|
||||||
resolve()
|
resolve()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default {
|
|||||||
await this.$store.dispatch('lock/unlockScreen')
|
await this.$store.dispatch('lock/unlockScreen')
|
||||||
this.$router.replace(lockPath)
|
this.$router.replace(lockPath)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = (err.response && err.response.data && err.response.data.msg) || err.msg || '密码错误,请重新输入'
|
const msg = err.message || err.toString()
|
||||||
this.showError(msg)
|
this.showError(msg)
|
||||||
this.password = ''
|
this.password = ''
|
||||||
this.$refs.passwordInput && this.$refs.passwordInput.focus()
|
this.$refs.passwordInput && this.$refs.passwordInput.focus()
|
||||||
|
|||||||
Reference in New Issue
Block a user