Jonlin пре 6 година
родитељ
комит
0c46b593c8

+ 2 - 4
application/admin/controller/Sensitivec.php

@@ -171,15 +171,13 @@ class Sensitivec extends Base
                 for($j=0;$j<count($sensitivewords);$j++){
                     if($info[$i]['sensitivewords_word'] == $sensitivewords[$j]['sensitivewords_word'] && $info[$i]['sensitivewords_for'] == $sensitivewords[$j]['sensitivewords_for']){
                         return json(['code' => -1, 'data' => url('sensitivec/index'), 'msg' => 'excel表第'.($i+1).'行敏感词已存在']);
-                        return $this->redirect('sensitivec/index');
-                        //header('sensitivec/index')
                     }
                 }
             }
             db('sensitivewords')->insertAll($info); //批量插入数据
-            return json(['code' => 1, 'data' => '', 'msg' => '插入敏感词成功']);
+            return json(['code' => 1, 'data' => url('sensitivec/index'), 'msg' => '插入敏感词成功']);
         } else {
-            return json(['code' => -2, 'data' => '', 'msg' => '插入敏感词失败']);
+            return json(['code' => -2, 'data' => url('sensitivec/index'), 'msg' => '插入敏感词失败']);
         }
     }
 }

+ 2 - 2
application/admin/controller/System.php

@@ -273,10 +273,10 @@ class System extends Base
                     $result[$key]['servicelog_close_type'] = '未知';
                 }
                 if($vo['servicelog_close_type'] == 1){
-                    $result[$key]['servicelog_close_type'] = '访客静默关闭';
+                    $result[$key]['servicelog_close_type'] = '访客静默';
                 }
                 if($vo['servicelog_close_type'] == 2){
-                    $result[$key]['servicelog_close_type'] = '会话超时关闭';
+                    $result[$key]['servicelog_close_type'] = '会话超时';
                 }
                 if($vo['servicelog_close_type'] == 3){
                     $result[$key]['servicelog_close_type'] = '客服关闭';

+ 19 - 0
application/admin/view/sensitivec/index.html

@@ -33,6 +33,9 @@
             </a>
             <form action="/admin/sensitivec/inserExcel" enctype="multipart/form-data" method="post" role="form" class="form-inline pull-right">
                 <div class="content clearfix m-b" style="margin-left: 50px;">
+                    <div class="form-group">
+                        <a href="/static/admin/file/sensitivewords.xlsx" class="btn btn-primary" style="margin-top:5px" >下载敏感词模板文件</a>
+                    </div>
                     <div class="form-group">
                         <label>导入敏感词:</label>
                         <input type="file" class="form-control" name="excel" style="width: 200px;border: none;" />
@@ -135,6 +138,22 @@
         });
     }
 
+    function showSuccess(res){
+
+        layer.ready(function(){
+            layer.close(index);
+            if(1 == res.code){
+                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
+                    window.location.href = myHost + '/admin/Sensitivec/index';
+                });
+            }else if(111 == res.code){
+                window.location.reload();
+            }else{
+                layer.msg(res.msg, {anim: 6});
+            }
+        });
+    }
+
     $(document).ready(function () {
         //调用函数,初始化表格
         initTable();

BIN
public/static/admin/file/sensitivewords.xlsx