QiFeng.ZWY.Dal/DalExt/VerificationCodeExtDal.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using QiFeng.LMSD.DBUtility;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.EnumModel;
using QiFeng.LMSD.Utility;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QiFeng.LMSD.Dal.DalExt
{
    public class VerificationCodeExtDal : BaseDal<VerificationCodeExtDal>
    {
        /// <summary>
        /// 发送验证码
        /// </summary>
        /// <param name="ipAddress"></param>
        /// <param name="consumerId"></param>
        /// <param name="mobile"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public string Send(string ipAddress, int consumerId, string mobile, VerificationCodeType type)
        {
            var ds = VerificationCodeDal.Instance.GetList(" IPAddress = '" + ipAddress + "' AND ConsumerId = " + consumerId + " AND Mobile = '" + mobile + "' AND VerificationCodeType = " + (int)type + " ");
            var list = ServicesHelper.DataSetToIList<VerificationCode>(ds).ToList();

            var ids = string.Empty;
            if (list != null && list.Count > 0)
            {

                ids = string.Join(",", list.Select(u => u.Id).ToList());
            }

            var result = string.Empty;
            using (var connection = new SqlConnection(DbHelperSQL.ConnectionString))
            {
                connection.Open();
                using (var sqlTrans = connection.BeginTransaction())
                {
                    try
                    {
                        var delRes = true;
                        if (!string.IsNullOrEmpty(ids))
                            delRes = DeleteList_VerificationCode(connection, sqlTrans, ids);

                        //随机验证码
                        var code = ConvertHelper.GetNumNonstr(6);

                        var model = new VerificationCode()
                        {
                            Code = code,
                            ConsumerId = consumerId,
                            EffectiveDuration = Convert.ToInt32(ConfigurationManager.AppSettings["EffectiveDuration"]),
                            IPAddress = ipAddress,
                            IsDelete = false,
                            Mobile = mobile,
后面还有 82 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。