com.huiyou.Bll/VerifyCodeService.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.huiyou.Dal;
using com.huiyou.Model;
using com.huiyou.Model.Tables;
using com.huiyou.Common;
using System.Data;
using System.Data.SqlClient;
namespace com.huiyou.Bll
{
public class VerifyCodeService
{
public static bool SendVerifyCode(string phone, string verifyCode, int userType, int userId = 0)
{
bool result = false;
try
{
//string text = "您的验证码为:" + verifyCode + ",请及时完成验证。";
//string ret = SmsMailHelper.SendSms(phone, text);
//if (string.IsNullOrEmpty(ret))
//{
// //throw new Exception("发送失败");
//}
//AliDY.SendVerifyCode(verifyCode, phone);
AliSmsHelper.SendAliSms(phone, verifyCode);
Tb_VerifyCode oVerifyCode = new Tb_VerifyCode();
oVerifyCode.VerifyCode = verifyCode;
oVerifyCode.CreateTime = DateTime.Now;
oVerifyCode.Phone = phone;
oVerifyCode.UserId = userId;
oVerifyCode.UserType = userType;
CreateVerifyCode(oVerifyCode);
result = true;
}
catch
{
result = false;
}
return result;
}
public static Tb_VerifyCode GetVerifyCode(string phone, int userType)
{
//获取最近一条十五分钟内的短信
string sql = "select top 1 * from Tb_VerifyCode where Phone='" + Util.SafeSQL(phone) + "'" + Environment.NewLine;
sql += "and userType=" + userType + Environment.NewLine;
sql += "and CreateTime>='" + DateTime.Now.AddMinutes(-15) + "' order by id desc";
List<Tb_VerifyCode> rst = TableFactory.GetList<Tb_VerifyCode>(sql);
if (rst.Count == 0) return null;
后面还有 21 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
