generated from root/miduo_server
删除白名单,删用户
parent
7048557d25
commit
aeb05e6af9
|
|
@ -11,7 +11,9 @@ import com.jmfy.model.BlackList;
|
|||
import com.jmfy.model.CUserInfo;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.redisProperties.RedisUserKey;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.utils.JsonUtil;
|
||||
import com.jmfy.utils.RPCClient;
|
||||
import com.jmfy.utils.RedisUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -30,6 +32,7 @@ import java.net.URLDecoder;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Controller
|
||||
public class GameTitleController {
|
||||
|
|
@ -41,6 +44,9 @@ public class GameTitleController {
|
|||
|
||||
@RequestMapping(value = "/toGameTitle",method = RequestMethod.GET)
|
||||
public String toGameTitle(ModelMap map,Integer type){
|
||||
if (type == 3) {
|
||||
return "gameTitle3";
|
||||
}
|
||||
try {
|
||||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
||||
map.addAttribute("serverInfo",allServerInfo);
|
||||
|
|
@ -50,6 +56,7 @@ public class GameTitleController {
|
|||
switch (type){
|
||||
case 1: return "gameTitle";
|
||||
case 2: return "gameTitle2";
|
||||
case 3: return "gameTitle3";
|
||||
default:break;
|
||||
}
|
||||
return "";
|
||||
|
|
@ -106,6 +113,49 @@ public class GameTitleController {
|
|||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/fenghaoByOpenId", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int fenghaoByOpenId(HttpSession session, ModelMap map, HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String openIds = parameterMap.get("openIds").trim();
|
||||
long banTime = Long.parseLong(parameterMap.get("banTime").trim());
|
||||
String banReason = parameterMap.get("banReason").trim();
|
||||
String[] split = openIds.split("#");
|
||||
// banTime == -1 解封
|
||||
if (banTime == -1) {
|
||||
for (String openId : split) {
|
||||
RedisUtil.getInstence().delObject(RedisUserKey.Ban_Open_Id, openId);
|
||||
}
|
||||
} else {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
banTime += currentTimeMillis;
|
||||
for (String openId : split) {
|
||||
List<CUserInfo> coreUserInfoList = userInfoDao.findUserInfo(openId);
|
||||
if (coreUserInfoList == null || coreUserInfoList.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
for (CUserInfo cUserInfo : coreUserInfoList) {
|
||||
String rpcString = RedisUtil.getInstence().getObject(RedisUserKey.LOGIC_SERVER_INFO, String.valueOf(cUserInfo.getServerid()), String.class, -1);
|
||||
if (null == rpcString) {
|
||||
continue;
|
||||
}
|
||||
String thriftIp = rpcString.split(":")[0];
|
||||
String thriftPort = rpcString.split(":")[1];
|
||||
if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Result result = RPCClient.gmSend("addblack " + cUserInfo.getUserId(), thriftIp, thriftPort);
|
||||
if (result.getResultCode() != 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
RedisUtil.getInstence().putObject(RedisUserKey.Ban_Open_Id, openId, banTime + "|" + banReason, -1);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
private boolean isSuccess(int serverId, int type, int banTime, String banReason, long sendTime, boolean isSuccess, int banEndTime, CUserInfo userInfo) throws Exception {
|
||||
switch (type) {
|
||||
case 0:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -173,6 +175,7 @@ public class LoginController {
|
|||
power = "管理员,所有权限";
|
||||
|
||||
}
|
||||
cAdminVo.setId(cAdmin.getId());
|
||||
cAdminVo.setPowers(power);
|
||||
cAdminVoList.add(cAdminVo);
|
||||
}
|
||||
|
|
@ -234,5 +237,29 @@ public class LoginController {
|
|||
return power.toString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/deleteUser", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public void deleteUser(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("id");
|
||||
if (id == null || id.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
CAdmin adminById = cUserDao.findAdminById(id);
|
||||
if (adminById == null || "root".equals(adminById.getUserName())) {
|
||||
response.setStatus(-2);
|
||||
return;
|
||||
}
|
||||
String userName = (String) request.getSession().getAttribute("username");
|
||||
if (!"root".equals(userName)) {
|
||||
response.setStatus(-3);
|
||||
return;
|
||||
}
|
||||
cUserDao.delUser(adminById);
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
response.sendRedirect("/findmemberlist");
|
||||
PrintWriter out = response.getWriter();
|
||||
out.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.jmfy.dao.*;
|
||||
import com.jmfy.dao.ServerInfoDao;
|
||||
import com.jmfy.dao.UserInfoDao;
|
||||
import com.jmfy.dao.impl.GSUserDaoImpl;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.model.GSItemBean;
|
||||
import com.jmfy.model.GSUser;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.model.WhiteList;
|
||||
import com.jmfy.model.vo.CUserVo;
|
||||
import com.jmfy.model.vo.RoleVo;
|
||||
import com.jmfy.redisProperties.GlobalsDef;
|
||||
import com.jmfy.utils.JsonUtil;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
|
|
@ -15,8 +17,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.ArrayList;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -166,4 +169,26 @@ public class UserInfoController {
|
|||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getAllWhites", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String getAllWhites(HttpSession session, ModelMap map) throws Exception {
|
||||
List<WhiteList> whiteLists = userInfoDao.findAllWhiteList();
|
||||
map.addAttribute("whiteLists", whiteLists);
|
||||
return "getAllWhite";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/delWhites", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public void delWhites(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String openid = parameterMap.get("openid");
|
||||
if (openid == null || openid.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
userInfoDao.delWhiteList(openid);
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
response.sendRedirect("/getAllWhites");
|
||||
PrintWriter out = response.getWriter();
|
||||
out.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ import java.util.List;
|
|||
public interface CUserDao {
|
||||
CAdmin findAdmin(String userName) throws Exception;
|
||||
|
||||
CAdmin findAdminById(String id) throws Exception;
|
||||
|
||||
void registerAdmin(CAdmin cAdmin) throws Exception;
|
||||
|
||||
List<CAdmin> findAdminList()throws Exception;
|
||||
|
||||
void delUser(CAdmin cAdmin) throws Exception;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ public interface UserInfoDao {
|
|||
void addWhiteList(WhiteList whiteList) throws Exception;
|
||||
WhiteList findWhiteListInfo(String openId) throws Exception;
|
||||
|
||||
List<WhiteList> findAllWhiteList() throws Exception;
|
||||
|
||||
void delWhiteList(String openId) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ public class CUserDaoImpl implements CUserDao {
|
|||
return mongoTemplate.findOne(query, CAdmin.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CAdmin findAdminById(String id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
return mongoTemplate.findById(id, CAdmin.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAdmin(CAdmin cAdmin) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
|
|
@ -41,4 +47,10 @@ public class CUserDaoImpl implements CUserDao {
|
|||
Query query = new Query();
|
||||
return mongoTemplate.find(query, CAdmin.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delUser(CAdmin cAdmin) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
mongoTemplate.remove(cAdmin);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,14 @@ public class UserInfoDaoImpl implements UserInfoDao {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WhiteList> findAllWhiteList() throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
Query query = new Query();
|
||||
return mongoTemplate.find(query, WhiteList.class);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delWhiteList(String openId) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.jmfy.model.vo;
|
||||
|
||||
public class CAdminVo {
|
||||
|
||||
public String id;
|
||||
|
||||
public String userName;
|
||||
|
||||
public String powers ;
|
||||
|
|
@ -12,4 +15,8 @@ public class CAdminVo {
|
|||
public void setPowers(String powers) {
|
||||
this.powers = powers;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public class RedisUserKey {
|
|||
public final static String CUser_ServerInfo_Key = "CUser_ServerInfo";
|
||||
public final static String Ban_Chat = "Ban_Chat";
|
||||
public final static String SERVER_OPEN_TIME_KEY = "Server_Open_Time_Key";
|
||||
public final static String Ban_Open_Id = "Ban_Open_Id";
|
||||
//问卷调查
|
||||
public static final String QUESTION_FROMBACK = "QUESTION_FROMBACK";
|
||||
public static final String QUESTION_FROMBACK_ALL = "QUESTION_FROMBACK_ALL";//所有问卷
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
<!--_meta 作为公共模版分离出去-->
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<link rel="Bookmark" href="../favicon.ico" />
|
||||
<link rel="Shortcut Icon" href="../favicon.ico" />
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="../static/lib/html5shiv.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/lib/Hui-iconfont/1.0.8/iconfont.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
|
||||
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
|
||||
<!--[if IE 6]>
|
||||
<script type="text/javascript" src="../static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
|
||||
<script>DD_belatedPNG.fix('*');</script>
|
||||
<![endif]-->
|
||||
<!--/meta 作为公共模版分离出去-->
|
||||
|
||||
<title>基本设置</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span>
|
||||
GM管理
|
||||
<span class="c-gray en">></span>
|
||||
根据openId封号
|
||||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
||||
</nav>
|
||||
<div class="page-container">
|
||||
<form class="form form-horizontal" id="form-article-add" action="" method="post">
|
||||
<div id="tab-system" class="HuiTab">
|
||||
<div class="tabBar cl">
|
||||
<span>根据openId封号</span>
|
||||
</div>
|
||||
<div class="tabCon">
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>用户openId:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<textarea class="textarea" name="openIds" placeholder="openid1#openid2#openid3...一次操作不要超过10个"></textarea>
|
||||
<span class="USERIDS"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
封号时长(秒):</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" name="banTime" placeholder="-1 可解除封号" value="" class="input-text"/>
|
||||
<span class="BANTIME"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
封号原因:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<input type="text" name="banReason" placeholder="诈骗" value="" class="input-text"/>
|
||||
<span class="BANREASON"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row cl">
|
||||
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
|
||||
<button onClick="return gameTitle3();" class="btn btn-primary radius" type="button" ><i class="Hui-iconfont"></i> 确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<!--_footer 作为公共模版分离出去-->
|
||||
<script type="text/javascript" src="../static/lib/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/layer/2.4/layer.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
|
||||
|
||||
<!--请在下方写此页面业务相关的脚本-->
|
||||
<script type="text/javascript" src="../static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
|
||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.skin-minimal input').iCheck({
|
||||
checkboxClass: 'icheckbox-blue',
|
||||
radioClass: 'iradio-blue',
|
||||
increaseArea: '20%'
|
||||
});
|
||||
$("#tab-system").Huitab({
|
||||
index: 0
|
||||
});
|
||||
});
|
||||
function gameTitle3() {
|
||||
var erroCode = $('.SERVERID');
|
||||
|
||||
var openIds = $("textarea[name='openIds']").val();
|
||||
if (openIds === '' || openIds == null) {
|
||||
erroCode = $('.USERIDS');
|
||||
erroCode.html('<span style="color: red; ">用户id不能为空!</span>');
|
||||
return false;
|
||||
}else {
|
||||
erroCode = $('.USERIDS');
|
||||
erroCode.html('<span style="color: red; "></span>');
|
||||
}
|
||||
var banTime = $("input[name='banTime']").val();
|
||||
var banReason = $("input[name='banReason']").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {
|
||||
"openIds": openIds,
|
||||
"banTime": banTime,
|
||||
"banReason": banReason,
|
||||
},
|
||||
url: "/fenghaoByOpenId",
|
||||
success: function (data) {
|
||||
if (data == 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
</script>
|
||||
<!--/请在上方写此页面业务相关的脚本-->
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="viewport"
|
||||
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
<script type="text/javascript" src="lib/html5shiv.js"></script>
|
||||
<script type="text/javascript" src="lib/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" type="text/css" href="h-ui/css/H-ui.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/H-ui.admin.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="h-ui.admin/skin/default/skin.css" id="skin"/>
|
||||
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/style.css"/>
|
||||
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
|
||||
<script>DD_belatedPNG.fix('*');</script>
|
||||
<title>白名单信息</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="breadcrumb">
|
||||
<i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span> 白名单信息
|
||||
<span class="c-gray en">></span> 白名单信息
|
||||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
|
||||
href="javascript:location.replace('/findServerInfo');" title="刷新"><i class="Hui-iconfont"></i></a></nav>
|
||||
<div class="page-container" style="text-align: center">
|
||||
<h2><span style="color:red;">删除白名单</span></h2>
|
||||
<div class="text-c">
|
||||
<div class="mt-20">
|
||||
<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
|
||||
<thead>
|
||||
<tr class="text-c">
|
||||
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
|
||||
<th width="200">openId</th>
|
||||
<th width="200">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="obj:${whiteLists}">
|
||||
<!--<td><input type="checkbox" value="" name=""/></td>-->
|
||||
<td th:text="${obj.id}" style="text-align: center;"></td>
|
||||
|
||||
<td style="text-align: center; width: 300px">
|
||||
<!-- <button type="button" th:id="${obj.id}" class="btn btn-primary"-->
|
||||
<!-- onclick="return deleteWhite(this)"><i class="Hui-iconfont"></i> 删除-->
|
||||
<!-- </button>-->
|
||||
<a title="" href="javascript:;" th:href="@{/delWhites(openid =${obj.id})}" class="ml-5" style="text-decoration:none"><span class="btn btn-primary radius" >删除</span></a> </a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!--_footer 作为公共模版分离出去-->
|
||||
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
|
||||
<script type="text/javascript" src="h-ui/js/H-ui.min.js"></script>
|
||||
<script type="text/javascript" src="h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
|
||||
|
||||
<!--请在下方写此页面业务相关的脚本-->
|
||||
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
|
||||
<script type="text/javascript">
|
||||
function deleteWhite(obj) {
|
||||
mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"openid": mailId},
|
||||
url: "/delWhites",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('删除成功!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
<li><a data-href="/html/sendSysCmd.html" data-title="发送gm" href="javascript:;">发送gm</a></li>
|
||||
<li><a data-href="noticeInfos" data-title="公告信息" href="javascript:void(0)">公告信息</a></li>
|
||||
<li><a data-href="/html/add_white_list.html" data-title="添加白名单账号" href="javascript:;">添加白名单账号</a></li>
|
||||
|
||||
<li><a data-href="getAllWhites" data-title="白名单列表" href="javascript:void(0)">删除白名单</a></li>
|
||||
|
||||
<!--<li><a data-href="/html/recoverItem.html" data-title="回收道具" href="javascript:;">回收道具</a></li>-->
|
||||
</ul>
|
||||
|
|
@ -147,6 +147,7 @@
|
|||
<ul>
|
||||
<li><a data-href="toGameTitle?type=1" data-title="禁言/踢下线/禁登录" href="javascript:;">禁言/踢下线/禁登录</a></li>
|
||||
<li><a data-href="toGameTitle?type=2" data-title="修改角色名" href="javascript:;">修改角色名</a></li>
|
||||
<li><a data-href="toGameTitle?type=3" data-title="根据openId封号" href="javascript:;">根据openId封号</a></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
|
|||
|
|
@ -37,13 +37,19 @@
|
|||
<tr class="text-c">
|
||||
<th width="100">用户名</th>
|
||||
<th width="300">权限功能</th>
|
||||
<!--<th width="50">操作</th>-->
|
||||
<th width="50">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="obj:${adminList}">
|
||||
<td th:text="${obj.userName}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.powers}" style="text-align: center;"></td>
|
||||
<td style="text-align: center; width: 300px">
|
||||
<!-- <button type="button" th:id="${obj.id}" class="btn btn-primary"-->
|
||||
<!-- onclick="return deleteUser(this)" ><i class="Hui-iconfont"></i> 删除用户-->
|
||||
<!-- </button>-->
|
||||
<a title="" href="javascript:;" th:href="@{/deleteUser(id =${obj.id})}" class="ml-5" style="text-decoration:none"><span class="btn btn-primary radius" >删除用户</span></a> </a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -60,6 +66,26 @@
|
|||
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
|
||||
<script type="text/javascript">
|
||||
function deleteUser(obj) {
|
||||
mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"id": mailId},
|
||||
url: "/deleteUser",
|
||||
success: function (data) {
|
||||
if (data == -1) {
|
||||
layer.msg('刷新页面重新操作!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == -2) {
|
||||
layer.msg('不能操作root用户!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == -3) {
|
||||
layer.msg('需要root权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue