DuGuYang 1 жил өмнө
parent
commit
252e644778

+ 1 - 1
Areas/Api/Controllers/v1/Main1/MerchantInfoController.cs

@@ -149,7 +149,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             RedisDbconn.Instance.Clear("MobileCodeCheck:" + Mobile);
             var Id = int.Parse(MerchantId);
             var query = main1db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
-            var loginMobile = main1db.MerchantLoginInfo.FirstOrDefault(m => m.LoginMobile == Mobile) ?? new MerchantLoginInfo();
+            var loginMobile = main1db.MerchantLoginInfo.FirstOrDefault(m => m.LoginMobile == query.Mobile) ?? new MerchantLoginInfo();
             Dictionary<string, object> fields = new Dictionary<string, object>();
             if (query.Id > 0)
             {

+ 5 - 4
Areas/Api/Controllers/v1/Main2/MerchantInfoController.cs

@@ -125,24 +125,25 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             JsonData data = JsonMapper.ToObject(value);
             string MerchantId = data["MerchantId"].ToString(); //商户Id
             string Mobile = data["Mobile"].ToString(); //新手机号
+            string MobileCode = data["MobileCode"].ToString(); //短信验证码
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             if (Mobile.Length != 11 || !function.IsInt(Mobile) || Mobile.Substring(0, 1) != "1")
             {
                 return new AppResultJson() { Status = "-1", Info = "手机号不正确" };
             }
-            MobileCodeCheck mobilecheck = RedisDbconn.Instance.Get<MobileCodeCheck>("MobileCodeCheck:" + Mobile);
-            if (mobilecheck == null)
+            var mobilecheck = RedisDbconn.Instance.Get<string>("MobileCodeCheck:" + Mobile);
+            if (mobilecheck == "")
             {
                 return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" };
             }
-            if (mobilecheck.CheckCode != Mobile)
+            if (mobilecheck != MobileCode)
             {
                 return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" };
             }
             RedisDbconn.Instance.Clear("MobileCodeCheck:" + Mobile);
             var Id = int.Parse(MerchantId);
             var query = main2db.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantInfo();
-            var loginMobile = main1db.MerchantLoginInfo.FirstOrDefault(m => m.LoginMobile == Mobile) ?? new Models.Main1.MerchantLoginInfo();
+            var loginMobile = main1db.MerchantLoginInfo.FirstOrDefault(m => m.LoginMobile == query.Mobile) ?? new Models.Main1.MerchantLoginInfo();
             Dictionary<string, object> fields = new Dictionary<string, object>();
             if (query.Id > 0)
             {