login
This commit is contained in:
@@ -151,23 +151,29 @@ export default {
|
||||
async _authlogin () {
|
||||
try {
|
||||
let res = await authlogin(this.username, encrypt(this.password))
|
||||
let obj = {}
|
||||
obj = Object.assign({}, res)
|
||||
this.$store.dispatch('userInfo', JSON.stringify(obj))
|
||||
this.hide()
|
||||
this.$router.push('/index/home')
|
||||
if (res.code === '1') {
|
||||
let obj = {}
|
||||
obj = Object.assign({}, res.result)
|
||||
this.$store.dispatch('userInfo', JSON.stringify(obj))
|
||||
this.hide()
|
||||
this.$router.push('/index/home')
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
} catch (err) {
|
||||
this.disabled = false
|
||||
// this.toast(err)
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('common.loading'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
setTimeout(() => {
|
||||
loading.close()
|
||||
}, 4000)
|
||||
if (err.status !== 400) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: this.$t('common.loading'),
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
setTimeout(() => {
|
||||
loading.close()
|
||||
}, 4000)
|
||||
}
|
||||
}
|
||||
},
|
||||
show (e) {
|
||||
|
||||
Reference in New Issue
Block a user