feat:CN-112: Header右上角修改密码功能开发和添加登录页面密码错误时加弹框

This commit is contained in:
晶晶 张
2021-08-24 17:36:27 +08:00
parent f43aafa3e1
commit 51db57d3a5
2 changed files with 88 additions and 13 deletions

View File

@@ -40,6 +40,7 @@
<script>
import { mapActions } from 'vuex'
import { post } from '@/utils/http'
import { ElMessage } from 'element-plus'
export default {
name: 'Login',
@@ -56,18 +57,22 @@ export default {
if (!this.username || !this.pin) {
return
}
if (!this.blockOperation.query) {
this.blockOperation.query = true
} else {
return
}
// if (!this.blockOperation.query) {
// this.blockOperation.query = true
// } else {
// return
// }
post('sys/login', { username: this.username, pin: this.pin }).then(
res => {
this.blockOperation.query = false
this.loading = true
if (res.code === 200) {
localStorage.setItem('cn-username', this.username)
if (res.code === 200 && res.msg == 'success') {
this.loading = true
this.blockOperation.query = true
this.loginSuccess(res)
localStorage.setItem('cn-username', this.username)
} else {
this.loading = false
this.blockOperation.query = false
ElMessage.error('密码错误')
}
}
)