Jonlin 6 years ago
parent
commit
1975b13315

+ 2 - 2
application/admin/view/system/conversation.html

@@ -98,14 +98,14 @@
                         </div>
                         <div class="form-group" style="flex-wrap: wrap; display: flex">
                             <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">当客服服务达到上限时,顾客会进入排队等待状态。当排队人数达上限,后续不再接入顾客。</p>
-                            <label class="col-sm-3 control-label">客服接待人数设置:</label>
+                            <label class="col-sm-3 control-label">单个客服接待人数:</label>
                             <div class="input-group col-sm-1" style="width: 45px">
                                 <input type="text" class="form-control" name="max_service" required="" aria-required="true" value="{$systemconfig[6]['systemconfig_data']}">
                             </div>
                             <label class="control-label" style="margin-left: 20px;">人</label>
                         </div>
                         <div class="form-group" style="flex-wrap: wrap; display: flex">
-                            <label class="col-sm-3 control-label">最大排队人数设置:</label>
+                            <label class="col-sm-3 control-label">最大排队人数上限:</label>
                             <div class="input-group col-sm-1" style="width: 45px">
                                 <input type="text" class="form-control" name="kfConfig_maxWait" required="" aria-required="true" value="{$systemconfig[7]['systemconfig_data']}">
                             </div>

+ 10 - 0
application/service/controller/Login.php

@@ -16,6 +16,16 @@ class Login extends Controller
 
     public function doLogin()
     {
+        //验证用户IP
+        @$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',2)->find();
+        $result = db('iplimit')->where('start_ip','<=',$intip)->where('end_ip','>=',$intip)->where('object',2)->find();
+        if(empty($res) && empty($result)){
+            return json(['code' => 0, 'data' => [], 'msg' => '访问受限']);
+        }
 
         $userAccount = input('post.username');
         $password = input('post.password');