vali 6 years ago
parent
commit
cf2ad1f02f
1 changed files with 6 additions and 6 deletions
  1. 6 6
      application/index/controller/Register.php

+ 6 - 6
application/index/controller/Register.php

@@ -99,15 +99,15 @@ class Register extends Common
     public function autoReg()
     {
         //验证用户IP
-        $settings = db('settings')->where('id',1)->find();
-        if($settings['account_black_list'] == 'on'){
+        $settings = db('settings')->where('id', 1)->find();
+        if ($settings['account_black_list'] == 'on') {
             @$ip = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
             $ip = ($ip) ? $ip : $_SERVER["REMOTE_ADDR"];
             //将ip地址转换成int型
             $intip = bindec(decbin(ip2long($ip)));
-            $res = db('iplimit')->where('ip',$ip)->where('object',1)->find();
-            $result = db('iplimit')->where('start_ip','<=',$intip)->where('end_ip','>=',$intip)->where('object',1)->find();
-            if(!empty($res) || !empty($result)){
+            $res = db('iplimit')->where('ip', $ip)->where('object', 1)->find();
+            $result = db('iplimit')->where('start_ip', '<=', $intip)->where('end_ip', '>=', $intip)->where('object', 1)->find();
+            if (!empty($res) || !empty($result)) {
                 return json(['code' => 0, 'data' => [], 'msg' => '访问受限']);
             }
         }
@@ -146,7 +146,7 @@ class Register extends Common
         $tokenvip = md5(md5(uniqid() . rand(60000, 90000)));
         $newdata = [
             'account_name' => $nowuid,
-            'password' => md5(time() . rand(1, 5000)),
+            'password' => md5(microtime() . rand(1, 5000)),
             'status' => 1,
             'add_time' => $now,
             'last_login_time' => $now,