Przeglądaj źródła

成检登录添加ip

konghe 1 rok temu
rodzic
commit
56895d7262
1 zmienionych plików z 17 dodań i 2 usunięć
  1. 17 2
      wwwroot/App_Code/WCF.cs

+ 17 - 2
wwwroot/App_Code/WCF.cs

@@ -56,10 +56,25 @@ public class WCF
     /// <returns></returns>
     public JObject LoadParaByLoginDefault()
     {
+        string _ip = "250.250.250.250";
+        string Name = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
+        try
+        {
+            _ip = HttpContext.Current.Request.UserHostAddress;
+            //Name = HttpContext.Current.Request.UserHostAddress;
+            //Name = HttpContext.Current.Request.LogonUserIdentity.Name;
+            //Name = HttpContext.Current.Request.RequestContext.HttpContext.Server.MachineName;
+
+        }
+        catch (Exception ex)
+        {
+
+        }
+
         JObject para = new JObject(
             new JProperty("macAddress", "xx:xx:xx:xx:xx:xx"),
-            new JProperty("ipAddress", "250.250.250.250"),
-            new JProperty("phoneCode", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
+            new JProperty("ipAddress", _ip),
+            new JProperty("phoneCode", Name),
             new JProperty("phoneType", "WebMes"),
             new JProperty("appVersion", "1.0"),
             new JProperty("systemType", "WindowsServer"),