From 498688264ee8787dfbe36d97d91d7075b0f325ec Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Fri, 12 Jul 2024 09:30:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=9F=AD=E4=BF=A1=EF=BC=9A=E6=8C=87=E5=AE=9A=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=BA=93=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LoginController.cs | 13 +++++++------ .../Learun.Application.WebApi/Modules/UserApi.cs | 12 ++++++------ .../Modules/UsernologinApi.cs | 4 ++-- .../Learun.Cache/Learun.Cache.Base/CacheId.cs | 4 ++++ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index c9078d0af..7765cb673 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -1261,7 +1261,7 @@ namespace Learun.Application.Web.Controllers //if (result.Result.code == "0") if (true) { - redisCache.Write("sendcodeinpc_" + codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0)); + redisCache.Write("sendcodeinpc_" + codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms); //日志 LogEntity logEntity = new LogEntity(); logEntity.F_CategoryId = 3; @@ -1308,7 +1308,7 @@ namespace Learun.Application.Web.Controllers { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinpc_" + codeType + "_" + phone); + var code = redisCache.Read("sendcodeinpc_" + codeType + "_" + phone, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == verifycode) { //return Success("验证成功。"); @@ -1345,7 +1345,7 @@ namespace Learun.Application.Web.Controllers { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinpc_" + codeType + "_" + phone); + var code = redisCache.Read("sendcodeinpc_" + codeType + "_" + phone, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == verifycode) { //return Success("验证成功。"); @@ -1395,10 +1395,11 @@ namespace Learun.Application.Web.Controllers logEntity.F_ExecuteResultJson = "登录成功"; logEntity.WriteLog(); //结果 - var succresult = new SuccResult() { + var succresult = new SuccResult() + { pwd = true }; - + return Success(succresult); } #endregion @@ -1408,7 +1409,7 @@ namespace Learun.Application.Web.Controllers return Fail("验证失败,验证码错误或已失效。"); } } - + #endregion /// 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 9fc2b8ad1..6b08ba801 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs @@ -72,7 +72,7 @@ namespace Learun.Application.WebApi { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile); + var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) { return Success("验证成功。"); @@ -124,7 +124,7 @@ namespace Learun.Application.WebApi //if (result.Result.code == "0") if (true) { - redisCache.Write("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, raRndNum, new TimeSpan(0, 5, 0)); + redisCache.Write("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms); //日志 LogEntity logEntity = new LogEntity(); logEntity.F_CategoryId = 3; @@ -332,7 +332,7 @@ namespace Learun.Application.WebApi { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username); + var code = redisCache.Read("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == loginModel.verifycode) { //return Success("验证成功。"); @@ -414,7 +414,7 @@ namespace Learun.Application.WebApi { return Fail("验证失败,验证码错误或已失效。"); } - + } /// @@ -503,7 +503,7 @@ namespace Learun.Application.WebApi { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile); + var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) { //return Success("验证成功。"); @@ -531,7 +531,7 @@ namespace Learun.Application.WebApi { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile); + var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) { //return Success("验证成功。"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs index c5a51c859..d6f30f2bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs @@ -64,7 +64,7 @@ namespace Learun.Application.WebApi { return Fail("手机号不能为空。"); } - var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile); + var code = redisCache.Read("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms); if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) { return Success("验证成功。"); @@ -119,7 +119,7 @@ namespace Learun.Application.WebApi //if (result.Result.code == "0") if (true) { - redisCache.Write("sendcodeinapp_" + loginModel.codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0)); + redisCache.Write("sendcodeinapp_" + loginModel.codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms); //日志 LogEntity logEntity = new LogEntity(); logEntity.F_CategoryId = 3; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs index e5b2591b0..42264b6b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs @@ -138,6 +138,10 @@ #endregion #region 8号库 + /// + /// sms + /// + public static int sms { get { return 8; } } #endregion #region 9号库