Pārlūkot izejas kodu

【修改】发送短信:指定缓存库;

西昌分支
dyy pirms 4 mēnešiem
vecāks
revīzija
498688264e
4 mainītis faili ar 19 papildinājumiem un 14 dzēšanām
  1. +7
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
  2. +6
    -6
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs
  3. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs
  4. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs

+ 7
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs Parādīt failu

@@ -1261,7 +1261,7 @@ namespace Learun.Application.Web.Controllers
//if (result.Result.code == "0") //if (result.Result.code == "0")
if (true) if (true)
{ {
redisCache.Write<string>("sendcodeinpc_" + codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0));
redisCache.Write<string>("sendcodeinpc_" + codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms);
//日志 //日志
LogEntity logEntity = new LogEntity(); LogEntity logEntity = new LogEntity();
logEntity.F_CategoryId = 3; logEntity.F_CategoryId = 3;
@@ -1308,7 +1308,7 @@ namespace Learun.Application.Web.Controllers
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinpc_" + codeType + "_" + phone);
var code = redisCache.Read<string>("sendcodeinpc_" + codeType + "_" + phone, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == verifycode) if (!string.IsNullOrEmpty(code) && code == verifycode)
{ {
//return Success("验证成功。"); //return Success("验证成功。");
@@ -1345,7 +1345,7 @@ namespace Learun.Application.Web.Controllers
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinpc_" + codeType + "_" + phone);
var code = redisCache.Read<string>("sendcodeinpc_" + codeType + "_" + phone, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == verifycode) if (!string.IsNullOrEmpty(code) && code == verifycode)
{ {
//return Success("验证成功。"); //return Success("验证成功。");
@@ -1395,10 +1395,11 @@ namespace Learun.Application.Web.Controllers
logEntity.F_ExecuteResultJson = "登录成功"; logEntity.F_ExecuteResultJson = "登录成功";
logEntity.WriteLog(); logEntity.WriteLog();
//结果 //结果
var succresult = new SuccResult() {
var succresult = new SuccResult()
{
pwd = true pwd = true
}; };
return Success(succresult); return Success(succresult);
} }
#endregion #endregion
@@ -1408,7 +1409,7 @@ namespace Learun.Application.Web.Controllers
return Fail("验证失败,验证码错误或已失效。"); return Fail("验证失败,验证码错误或已失效。");
} }
} }
#endregion #endregion


/// <summary> /// <summary>


+ 6
- 6
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs Parādīt failu

@@ -72,7 +72,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile);
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode)
{ {
return Success("验证成功。"); return Success("验证成功。");
@@ -124,7 +124,7 @@ namespace Learun.Application.WebApi
//if (result.Result.code == "0") //if (result.Result.code == "0")
if (true) if (true)
{ {
redisCache.Write<string>("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, raRndNum, new TimeSpan(0, 5, 0));
redisCache.Write<string>("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms);
//日志 //日志
LogEntity logEntity = new LogEntity(); LogEntity logEntity = new LogEntity();
logEntity.F_CategoryId = 3; logEntity.F_CategoryId = 3;
@@ -332,7 +332,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username);
var code = redisCache.Read<string>("sendcodeinapp_" + loginModel.codeType + "_" + loginModel.username, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == loginModel.verifycode) if (!string.IsNullOrEmpty(code) && code == loginModel.verifycode)
{ {
//return Success("验证成功。"); //return Success("验证成功。");
@@ -414,7 +414,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("验证失败,验证码错误或已失效。"); return Fail("验证失败,验证码错误或已失效。");
} }
} }


/// <summary> /// <summary>
@@ -503,7 +503,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile);
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode)
{ {
//return Success("验证成功。"); //return Success("验证成功。");
@@ -531,7 +531,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile);
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode)
{ {
//return Success("验证成功。"); //return Success("验证成功。");


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UsernologinApi.cs Parādīt failu

@@ -64,7 +64,7 @@ namespace Learun.Application.WebApi
{ {
return Fail("手机号不能为空。"); return Fail("手机号不能为空。");
} }
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile);
var code = redisCache.Read<string>("sendcodeinapp_" + mobileVerify.codeType + "_" + mobileVerify.mobile, CacheId.sms);
if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode) if (!string.IsNullOrEmpty(code) && code == mobileVerify.verifycode)
{ {
return Success("验证成功。"); return Success("验证成功。");
@@ -119,7 +119,7 @@ namespace Learun.Application.WebApi
//if (result.Result.code == "0") //if (result.Result.code == "0")
if (true) if (true)
{ {
redisCache.Write<string>("sendcodeinapp_" + loginModel.codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0));
redisCache.Write<string>("sendcodeinapp_" + loginModel.codeType + "_" + userEntity.F_Mobile, raRndNum, new TimeSpan(0, 5, 0), CacheId.sms);
//日志 //日志
LogEntity logEntity = new LogEntity(); LogEntity logEntity = new LogEntity();
logEntity.F_CategoryId = 3; logEntity.F_CategoryId = 3;


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Cache/Learun.Cache.Base/CacheId.cs Parādīt failu

@@ -138,6 +138,10 @@
#endregion #endregion


#region 8号库 #region 8号库
/// <summary>
/// sms
/// </summary>
public static int sms { get { return 8; } }
#endregion #endregion


#region 9号库 #region 9号库


Notiek ielāde…
Atcelt
Saglabāt