stanley-king 3 years ago
parent
commit
42308a82c4
1 changed files with 9 additions and 9 deletions
  1. 9 9
      mobile/control/merchant.php

+ 9 - 9
mobile/control/merchant.php

@@ -21,15 +21,15 @@ class merchantControl
             throw new Exception("机构已被关闭。");
         }
 
-//        $ips = unserialize($mchinfo['ip_white_list']);
-//        if(!empty($ips)) {
-//            $addr = $_SERVER['REMOTE_ADDR'];
-//            Log::record("request ip:{$addr}",Log::DEBUG);
-//
-//            if(!in_array($addr,$ips)) {
-//                throw new Exception("请求地址不在白名单中");
-//            }
-//        }
+        $ips = unserialize($mchinfo['ip_white_list']);
+        if(!empty($ips)) {
+            $addr = $_SERVER['REMOTE_ADDR'];
+            Log::record("request ip:{$addr}",Log::DEBUG);
+
+            if(!in_array($addr,$ips)) {
+                throw new Exception("请求地址不在白名单中");
+            }
+        }
 
         $this->mUseKey = intval($mchinfo['use_key']);
         if($this->mUseKey && !$this->verify_md5($mchinfo['secure_key'])) {