From 99a78dafddd6366f41f13bea4a2e106d7a52474c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E5=AF=92?= <823756726@qq.com> Date: Wed, 13 Nov 2024 11:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/UserApi.cs | 14 ++++- .../LearunApp-2.2.0/pages/login.vue | 63 ++++++++++--------- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs index de2b9707d..a5e287cef 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs @@ -73,7 +73,7 @@ namespace Learun.Application.WebApi var isSend = GetAccountIsSendMsg(account.account); if (!isSend.HasValue) { - return Fail("请维护用户手机号信息"); + return Fail("请检查登录账号信息"); } return Success(new { sendresult = isSend }); } @@ -86,7 +86,7 @@ namespace Learun.Application.WebApi var account = this.GetReqData(); var isSend = GetAccountIsSendMsg(account.account); if (!isSend.HasValue) - return Fail("请维护用户手机号信息"); + return Fail("请检查登录账号信息"); if (!isSend.Value) return Fail("该用户不需要短信登录"); @@ -143,6 +143,14 @@ namespace Learun.Application.WebApi private bool? GetAccountIsSendMsg(string account) { var userEntity = userIBLL.GetEntityByMobile(account); + if (userEntity==null) + { + userEntity = userIBLL.GetEntityByAccount(account); + if (userEntity==null) + { + return null; + } + } //是否强密码验证 bool pwd = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true"; //是否发送短信 @@ -343,7 +351,7 @@ namespace Learun.Application.WebApi return Fail(userEntity.LoginMsg); } if (!isSend.HasValue) - return Fail("请维护用户手机号信息"); + return Fail("请检查登录账号信息"); if (isSend.Value) { if (string.IsNullOrEmpty(loginModel.verifycode)) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue index 8b148f576..741068ad5 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue @@ -27,7 +27,7 @@ - + @@ -37,7 +37,8 @@ @@ -62,8 +63,8 @@ - + {{ PLATFORM_TEXT }}一键登录 @@ -101,10 +102,10 @@ devAccountList: [], resData: {}, - loginResult:{}, - logininfo:{}, + loginResult: {}, + logininfo: {}, needCode: false, - hasSendCode:false, + hasSendCode: false, mobile: '', verifycode: '', time: 0, @@ -210,7 +211,7 @@ if (!type && !check()) { return } - if (this.needCode&&!this.verifycode) { + if (this.needCode && !this.verifycode) { this.TOAST('请输入验证码'); return } @@ -231,10 +232,10 @@ username, password: this.MD5(password), up: up, - verifycode:this.verifycode||undefined + verifycode: this.verifycode || undefined }) if (postResult[1].data.code == '200') { - if(postResult[1].data.data.sendresult){ + if (postResult[1].data.data.sendresult) { // this.TOAST(postResult[1].data.data.msg); this.HIDE_LOADING() this.needCode = true @@ -251,7 +252,7 @@ this.username = "" this.password = "" this.verifycode = "" - + } else { this.TOAST(postResult[1].data.info); } @@ -300,7 +301,7 @@ user } this.HIDE_LOADING() - + this.SET_GLOBAL('token', this.resData.token) this.SET_GLOBAL('loginUser', this.resData.user) this.SET_STORAGE("logintime", this.resData.user.logTime); @@ -312,15 +313,15 @@ if (this.loginResult.pwd === true) { this.SET_STORAGE('pwd', true); this.TOAST("您的密码不满足强度要求,请您先修改密码后再执行系统其他操作"); - setTimeout(()=>{ + setTimeout(() => { this.NAV_TO('/pages/my/newpassword') - },1000) + }, 1000) return; } else { this.SET_STORAGE('pwd', false); this.TAB_TO('/pages/home') } - + // // 如果没发短信直接登录 // if(!this.loginResult.sendresult){ // this.checkverifycode(false) @@ -342,14 +343,16 @@ // }, 1000); }, // 获取是否需要验证码 - getNeedCode(){ - if(!this.username)return - this.POST('learun/adms/user/loginverify',{account:this.username}).then(res=>{ + getNeedCode() { + if (!this.username) return + this.POST('learun/adms/user/loginverify', { + account: this.username + }).then(res => { if (res[1].data.code != '200') { this.TOAST(res[1].data.info); return } - if(res[1].data.data.sendresult){ + if (res[1].data.data.sendresult) { this.needCode = true } }) @@ -368,15 +371,17 @@ return true }, // 发送验证码 - sendCode(){ + sendCode() { this.LOADING() - this.HTTP_POST('learun/adms/user/sendmsg',{account:this.username}).then(res=>{ + this.HTTP_POST('learun/adms/user/sendmsg', { + account: this.username + }).then(res => { this.HIDE_LOADING() - if(!res){ + if (!res) { return } this.TOAST(res.msg); - if(!res.sendstate)return + if (!res.sendstate) return this.hasSendCode = true this.time = 60 this.timeT = setInterval(() => { @@ -390,8 +395,8 @@ }) }, // 验证码校验 - async checkverifycode(needCheck=true) { - if(needCheck){ + async checkverifycode(needCheck = true) { + if (needCheck) { if (!this.verifycode) { this.TOAST('请输入验证码'); return @@ -426,16 +431,16 @@ if (this.loginResult.pwd === true) { this.SET_STORAGE('pwd', true); this.TOAST("您的密码不满足强度要求,请您先修改密码后再执行系统其他操作"); - setTimeout(()=>{ + setTimeout(() => { this.NAV_TO('/pages/my/newpassword') - },1000) + }, 1000) return; } else { this.SET_STORAGE('pwd', false); this.TAB_TO('/pages/home') } - - + + }, toLogin() { this.resData = {}