From 328359dfde7c478585594a3ad37c398580997be9 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 27 Dec 2024 14:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95ip=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f37debd8..8944d0a3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -308,6 +308,8 @@ export default { Img1, toggleRoleVisible: false, toggleRoleLoading: false, + + LoginState: 0, } }, computed: { @@ -383,10 +385,12 @@ export default { loginIn(Id) { this.loading = true this.showCode = false + this.LoginState = 0 if (Id) this.loginForm.UserId = Id this.$store .dispatch('user/login', this.loginForm) .then((res) => { + this.LoginState = res.BasicInfo.LoginState if (res.BasicInfo.IsFirstAdd) { // 当前用户为首次登录,请先修改密码之后再次登录 this.$message.success(this.$t('login:message:login1')) @@ -422,11 +426,12 @@ export default { }, }) return - } else if (res.BasicInfo.LoginState === 2) { - // 本次登录的IP或设备与上次不一致,请确认' - // this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning')) - this.$message.warning(this.$t('login:message:login4')) } + // else if (res.BasicInfo.LoginState === 2) { + // // 本次登录的IP或设备与上次不一致,请确认' + // // this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning')) + // this.$message.warning(this.$t('login:message:login4')) + // } if ( Array.isArray(this.$store.state.user.roles) && this.$store.state.user.roles.length === 1 @@ -455,6 +460,9 @@ export default { if (res && res.length > 0) { this.$store.dispatch('global/getNoticeList') this.$router.addRoutes(res) + if (this.LoginState === 2) { + this.$message.warning(this.$t('login:message:login4')) + } if (this.loginType === 'DevOps') { this.$router.replace({ path: res[0].path }) return