QiFeng.ZWY.Api/Controllers/ShortMessageController.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using log4net;
using QiFeng.LMSD.Api.Models;
using QiFeng.LMSD.Bll;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.EnumModel;
using QiFeng.LMSD.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace QiFeng.LMSD.Api.Controllers
{
public class ShortMessageController : BaseApiController
{
private readonly ILog logger = LogManager.GetLogger(typeof(ConsumerController));
/// <summary>
/// 手机发送验证码
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public Result SendVerificationCode([FromBody]SendVerificationCodeModel model)
{
Result<string> result = new Result<string>() { Status = false, StatusCode = (int)SysStatusCode.SystemError, Message = "系统错误" };
try
{
var strSign = model.random + model.ipAddress + model.consumerId + model.mobile + model.type;
var str = EncryptionLibCbc.Decrypt(model.sign);
if (!model.sign.Equals(EncryptionLibCbc.Encrypt(strSign)))
throw new FormatException("请求参数错误");
var code = VerificationCodeBll.Instance.Send(model.ipAddress, model.consumerId, model.mobile, model.type);
if (string.IsNullOrEmpty(code))
{
result.Status = false;
result.StatusCode = (int)SysStatusCode.Error_SendVerificationCode;
result.Message = "发送验证码失败";
}
else
{
result.Status = true;
result.StatusCode = (int)SysStatusCode.Success;
result.Message = "发送成功";
}
}
catch (Exception ex)
{
result.Status = false;
result.StatusCode = (int)SysStatusCode.SystemError;
#if DEBUG
result.Message = ex.Message + ex.StackTrace;
#else
result.Message = "系统错误";
#endif
if (ex.GetType() == typeof(FormatException)) result.Message = ex.Message;
后面还有 53 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。