示例#1
0
        public static void DeleteCodeWithExtension(this SMSCodeComponent scc, SMSBusiness business, string uniqueKey)
        {
            scc.DeleteSMSCode(business, uniqueKey);
            var cacheExtensionKey = $"{scc.Platform}:{business}:Code:{uniqueKey}:Extension";

            RedisHelper.KeyDelete(Constant.REDIS_SMS_DBINDEX, cacheExtensionKey);
        }
示例#2
0
        public static void SendWithExtension(this SMSCodeComponent scc, SMSBusiness business, string uniqueKey, string cellphone, object extension)
        {
            scc.Send(business, uniqueKey, cellphone);
            var cacheExtensionKey = $"{scc.Platform}:{business}:Code:{uniqueKey}:Extension";

            RedisHelper.Set(Constant.REDIS_SMS_DBINDEX, cacheExtensionKey, extension, TimeSpan.FromMinutes(Constant.TEMPTOKEN_EXPIRED_TIME));
        }
示例#3
0
        public static T VerifyWithExtension <T>(this SMSCodeComponent scc, SMSBusiness business, string uniqueKey, string code, bool deleteCode)
        {
            scc.Verify(business, uniqueKey, code, deleteCode);

            var cacheExtensionKey = $"{scc.Platform}:{business}:Code:{uniqueKey}:Extension";
            var cacheExtension    = RedisHelper.Get <T>(Constant.REDIS_SMS_DBINDEX, cacheExtensionKey);

            if (deleteCode)
            {
                RedisHelper.KeyDelete(Constant.REDIS_SMS_DBINDEX, cacheExtensionKey);
            }

            return(cacheExtension);
        }