|
|
@@ -155,6 +155,9 @@
|
|
|
if (getPasswordErrorCount === 3) {
|
|
|
this.$message.error('当前已输错密码3次,若达到5次今日将无法登陆')
|
|
|
}
|
|
|
+ if (getPasswordErrorCount === 4) {
|
|
|
+ this.$message.error('当前已输错密码4次,若达到5次今日将无法登陆')
|
|
|
+ }
|
|
|
this.isLoginDisabled = false
|
|
|
this.checkUsername = true
|
|
|
this.showCheckCode = true
|
|
|
@@ -222,6 +225,9 @@
|
|
|
this.getCookie()
|
|
|
}
|
|
|
})
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.validUserName()
|
|
|
+ })
|
|
|
},
|
|
|
computed: {
|
|
|
enterprise () {
|
|
|
@@ -234,6 +240,44 @@
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取用户错误次数
|
|
|
+ validUserName () {
|
|
|
+ if (this.login.username) {
|
|
|
+ // 获取密码输错次数
|
|
|
+ this.$http.get(`/sso/login/getPwdErrorCount`, {params: {username: this.login.username}})
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.success) {
|
|
|
+ let getPasswordErrorCount = response.data.content || ''
|
|
|
+ if (getPasswordErrorCount >= 5) {
|
|
|
+ this.$message.error('密码错误次数已达上限,今日无法登陆')
|
|
|
+ this.isLoginDisabled = true
|
|
|
+ this.showCheckCode = false
|
|
|
+ } else if (getPasswordErrorCount < 3) {
|
|
|
+ this.isLoginDisabled = false
|
|
|
+ this.checkUsername = true
|
|
|
+ this.showCheckCode = false
|
|
|
+ } else if (getPasswordErrorCount >= 3 && getPasswordErrorCount < 5) {
|
|
|
+ if (getPasswordErrorCount === 3) {
|
|
|
+ this.$message.error('当前已输错密码3次,若达到5次今日将无法登陆')
|
|
|
+ }
|
|
|
+ if (getPasswordErrorCount === 4) {
|
|
|
+ this.$message.error('当前已输错密码4次,若达到5次今日将无法登陆')
|
|
|
+ }
|
|
|
+ this.isLoginDisabled = false
|
|
|
+ this.checkUsername = true
|
|
|
+ this.showCheckCode = true
|
|
|
+ } else {
|
|
|
+ this.checkUsername = false
|
|
|
+ this.showCheckCode = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Promise.reject(response.data)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error(err.errMsg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 更换管理员
|
|
|
changeManage () {
|
|
|
window.location.href = `appeals/changeManagerAppeal${this.$store.state.option.fullPath}`
|