|
|
@@ -20,7 +20,8 @@
|
|
|
<div class="ibox-title" style="width: 100px; cursor:pointer;" id="current1" onclick="current(2)">
|
|
|
<h5>客服白名单</h5>
|
|
|
</div>
|
|
|
- <div class="ibox-title" id="current2" style="width: 100px; cursor:pointer; background: #eee" onclick="current(1)">
|
|
|
+ <div class="ibox-title" id="current2" style="width: 100px; cursor:pointer; background: #eee"
|
|
|
+ onclick="current(1)">
|
|
|
<h5>用户黑名单</h5>
|
|
|
</div>
|
|
|
<div class="ibox-title" style="width: calc(100% - 200px); background: #eee;">
|
|
|
@@ -33,13 +34,16 @@
|
|
|
</a>
|
|
|
|
|
|
|
|
|
- <form action="/admin/sensitivec/disjunctor" enctype="multipart/form-data" method="post" role="form" class="form-inline pull-right">
|
|
|
+ <form action="/admin/sensitivec/disjunctor" enctype="multipart/form-data" method="post" role="form"
|
|
|
+ class="form-inline pull-right">
|
|
|
<div class="content clearfix m-b">
|
|
|
<div class="form-group" style="margin-left: 20px">
|
|
|
- <a href="javascript:disjunctor()" class="btn" style="margin-top:5px;" >
|
|
|
+ <a href="javascript:disjunctor()" class="btn" style="margin-top:5px;">
|
|
|
<input type="hidden" id="account_black_list" value="{$settings['account_black_list']}">
|
|
|
<input type="hidden" id="kf_white_list" value="{$settings['kf_white_list']}">
|
|
|
- <input type="button" id="disjunctor" class="btn {if($settings['kf_white_list']=='on')}btn-primary{else}btn-danger{/if} btn-sm" value="{$settings['white_list']}" style="height: 30px;margin-top: -7px;">
|
|
|
+ <input type="button" id="disjunctor"
|
|
|
+ class="btn {if($settings['kf_white_list']=='on')}btn-primary{else}btn-danger{/if} btn-sm"
|
|
|
+ value="{$settings['white_list']}" style="height: 30px;margin-top: -7px;">
|
|
|
</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -51,7 +55,8 @@
|
|
|
<div class="content clearfix m-b">
|
|
|
<div class="form-group">
|
|
|
<label>IP地址:</label>
|
|
|
- <input type="text" class="form-control" id="content" name="content" value="" placeholder="请输入IP地址" style="height: 30px;">
|
|
|
+ <input type="text" class="form-control" id="content" name="content" value=""
|
|
|
+ placeholder="请输入IP地址" style="height: 30px;">
|
|
|
<input style="display: none">
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
@@ -91,28 +96,28 @@
|
|
|
function current(id) {
|
|
|
$("#type").val(id);
|
|
|
if (id == 1) {
|
|
|
- $("#current1").css("background","#eee");
|
|
|
- $("#current2").css("background","#fff");
|
|
|
- $("#add").attr('href','/admin/iplimit/add.html?type=1');
|
|
|
- if($('#account_black_list').val() == 'on'){
|
|
|
+ $("#current1").css("background", "#eee");
|
|
|
+ $("#current2").css("background", "#fff");
|
|
|
+ $("#add").attr('href', '/admin/iplimit/add.html?type=1');
|
|
|
+ if ($('#account_black_list').val() == 'on') {
|
|
|
$('#disjunctor').val('关闭用户黑名单');
|
|
|
$("#disjunctor").addClass("btn-primary");
|
|
|
$("#disjunctor").removeClass("btn-danger");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$('#disjunctor').val('开启用户黑名单');
|
|
|
$("#disjunctor").addClass("btn-danger");
|
|
|
$("#disjunctor").removeClass("btn-primary");
|
|
|
}
|
|
|
|
|
|
} else if (id == 2) {
|
|
|
- $("#current2").css({"background":"#eee"});
|
|
|
- $("#current1").css({"background":"#fff"});
|
|
|
- $("#add").attr('href','/admin/iplimit/add.html?type=2');
|
|
|
- if($('#kf_white_list').val() == 'on'){
|
|
|
+ $("#current2").css({"background": "#eee"});
|
|
|
+ $("#current1").css({"background": "#fff"});
|
|
|
+ $("#add").attr('href', '/admin/iplimit/add.html?type=2');
|
|
|
+ if ($('#kf_white_list').val() == 'on') {
|
|
|
$('#disjunctor').val('关闭客服白名单');
|
|
|
$("#disjunctor").addClass("btn-primary");
|
|
|
$("#disjunctor").removeClass("btn-danger");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$('#disjunctor').val('开启客服白名单');
|
|
|
$("#disjunctor").addClass("btn-danger");
|
|
|
$("#disjunctor").removeClass("btn-primary");
|
|
|
@@ -120,6 +125,7 @@
|
|
|
}
|
|
|
initTable()
|
|
|
}
|
|
|
+
|
|
|
function initTable() {
|
|
|
//先销毁表格
|
|
|
$('#cusTable').bootstrapTable('destroy');
|
|
|
@@ -131,46 +137,46 @@
|
|
|
striped: true, //表格显示条纹
|
|
|
pagination: true, //启动分页
|
|
|
pageSize: 50, //每页显示的记录数
|
|
|
- pageNumber:1, //当前第几页
|
|
|
+ pageNumber: 1, //当前第几页
|
|
|
pageList: [20, 50], //记录数可选列表
|
|
|
sidePagination: "server", //表示服务端请求
|
|
|
paginationFirstText: "首页",
|
|
|
paginationPreText: "上一页",
|
|
|
paginationNextText: "下一页",
|
|
|
paginationLastText: "尾页",
|
|
|
- queryParamsType : "undefined",
|
|
|
+ queryParamsType: "undefined",
|
|
|
queryParams: function queryParams(params) { //设置查询参数
|
|
|
var param = {
|
|
|
pageNumber: params.pageNumber,
|
|
|
type: type,
|
|
|
pageSize: params.pageSize,
|
|
|
- searchText:$('#content').val()
|
|
|
+ searchText: $('#content').val()
|
|
|
};
|
|
|
return param;
|
|
|
},
|
|
|
- onLoadSuccess: function(res){ //加载成功时执行
|
|
|
- if(111 == res.code){
|
|
|
+ onLoadSuccess: function (res) { //加载成功时执行
|
|
|
+ if (111 == res.code) {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
- layer.msg("加载成功", {time : 1000});
|
|
|
+ layer.msg("加载成功", {time: 1000});
|
|
|
},
|
|
|
- onLoadError: function(){ //加载失败时执行
|
|
|
+ onLoadError: function () { //加载失败时执行
|
|
|
layer.msg("加载数据失败");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function showSuccess(res){
|
|
|
+ function showSuccess(res) {
|
|
|
|
|
|
- layer.ready(function(){
|
|
|
+ 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/iplimit/index';
|
|
|
+ if (1 == res.code) {
|
|
|
+ layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function () {
|
|
|
+ window.location.href = '/admin/iplimit/index';
|
|
|
});
|
|
|
- }else if(111 == res.code){
|
|
|
+ } else if (111 == res.code) {
|
|
|
window.location.reload();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
layer.msg(res.msg, {anim: 6});
|
|
|
}
|
|
|
});
|
|
|
@@ -184,17 +190,17 @@
|
|
|
$("#search").bind("click", initTable);
|
|
|
});
|
|
|
|
|
|
- function Del(id){
|
|
|
- layer.confirm('确认删除此ip?', {icon: 3, title:'提示'}, function(index){
|
|
|
+ function Del(id) {
|
|
|
+ layer.confirm('确认删除此ip?', {icon: 3, title: '提示'}, function (index) {
|
|
|
//do something
|
|
|
- $.getJSON("{:url('iplimit/del')}", {'id' : id}, function(res){
|
|
|
- if(1 == res.code){
|
|
|
- layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
|
|
|
+ $.getJSON("{:url('iplimit/del')}", {'id': id}, function (res) {
|
|
|
+ if (1 == res.code) {
|
|
|
+ layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function () {
|
|
|
initTable();
|
|
|
});
|
|
|
- }else if(111 == res.code){
|
|
|
+ } else if (111 == res.code) {
|
|
|
window.location.reload();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
layer.alert(res.msg, {title: '友情提示', icon: 2});
|
|
|
}
|
|
|
});
|
|
|
@@ -204,50 +210,50 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- function disjunctor(){
|
|
|
- if($('#disjunctor').val() == '开启客服白名单'){
|
|
|
+ function disjunctor() {
|
|
|
+ if ($('#disjunctor').val() == '开启客服白名单') {
|
|
|
var disjunctor = 'on';
|
|
|
var type = 'kf';
|
|
|
}
|
|
|
- if($('#disjunctor').val() == '关闭客服白名单'){
|
|
|
+ if ($('#disjunctor').val() == '关闭客服白名单') {
|
|
|
var disjunctor = 'off';
|
|
|
var type = 'kf';
|
|
|
}
|
|
|
- if($('#disjunctor').val() == '开启用户黑名单'){
|
|
|
+ if ($('#disjunctor').val() == '开启用户黑名单') {
|
|
|
var disjunctor = 'on';
|
|
|
var type = 'account';
|
|
|
}
|
|
|
- if($('#disjunctor').val() == '关闭用户黑名单'){
|
|
|
+ if ($('#disjunctor').val() == '关闭用户黑名单') {
|
|
|
var disjunctor = 'off';
|
|
|
var type = 'account';
|
|
|
}
|
|
|
- layer.confirm('确认'+$('#disjunctor').val()+'?', {icon: 3, title:'提示'}, function(index){
|
|
|
+ layer.confirm('确认' + $('#disjunctor').val() + '?', {icon: 3, title: '提示'}, function (index) {
|
|
|
//do something
|
|
|
- $.getJSON("{:url('iplimit/disjunctor')}", {'disjunctor':disjunctor,'type':type}, function(res){
|
|
|
+ $.getJSON("{:url('iplimit/disjunctor')}", {'disjunctor': disjunctor, 'type': type}, function (res) {
|
|
|
//console.log(disjunctor);
|
|
|
console.log(res);
|
|
|
- if(1 == res.code){
|
|
|
- layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
|
|
|
+ if (1 == res.code) {
|
|
|
+ layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function () {
|
|
|
initTable();
|
|
|
- if(res.msg == '开启客服白名单成功'){
|
|
|
+ if (res.msg == '开启客服白名单成功') {
|
|
|
$('#disjunctor').val('关闭客服白名单');
|
|
|
$('#kf_white_list').val('on');
|
|
|
$("#disjunctor").addClass("btn-primary");
|
|
|
$("#disjunctor").removeClass("btn-danger");
|
|
|
}
|
|
|
- if(res.msg == '关闭客服白名单成功'){
|
|
|
+ if (res.msg == '关闭客服白名单成功') {
|
|
|
$('#disjunctor').val('开启客服白名单');
|
|
|
$('#kf_white_list').val('off');
|
|
|
$("#disjunctor").addClass("btn-danger");
|
|
|
$("#disjunctor").removeClass("btn-primary");
|
|
|
}
|
|
|
- if(res.msg == '开启用户黑名单成功'){
|
|
|
+ if (res.msg == '开启用户黑名单成功') {
|
|
|
$('#disjunctor').val('关闭用户黑名单');
|
|
|
$('#account_black_list').val('on');
|
|
|
$("#disjunctor").addClass("btn-primary");
|
|
|
$("#disjunctor").removeClass("btn-danger");
|
|
|
}
|
|
|
- if(res.msg == '关闭用户黑名单成功'){
|
|
|
+ if (res.msg == '关闭用户黑名单成功') {
|
|
|
$('#disjunctor').val('开启用户黑名单');
|
|
|
$('#account_black_list').val('off');
|
|
|
$("#disjunctor").addClass("btn-danger");
|
|
|
@@ -255,9 +261,9 @@
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- }else if(111 == res.code){
|
|
|
+ } else if (111 == res.code) {
|
|
|
window.location.reload();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
layer.alert(res.msg, {title: '友情提示', icon: 2});
|
|
|
}
|
|
|
});
|