generated from root/miduo_server
master
parent
6dc4d652b3
commit
14ec9aa9f3
|
@ -2,6 +2,7 @@ package com.ljsd.controller;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ljsd.redis.RedisKey;
|
||||
import com.ljsd.redis.RedisUtil;
|
||||
import com.ljsd.util.*;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBObject;
|
||||
|
@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class GetUserController extends HttpServlet {
|
||||
private final static String _COLLECTION_NAME = "user_info";
|
||||
|
@ -61,6 +63,21 @@ public class GetUserController extends HttpServlet {
|
|||
response.sendError(400, "openId is empety");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String banInfo = BaseGlobal.getInstance().redisApp.get(RedisKey.Ban_Open_Id, openId, String.class, -1);
|
||||
if (banInfo != null) {
|
||||
String[] split = banInfo.split("\\|");
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
if (Long.parseLong(split[0]) > currentTimeMillis) {
|
||||
response.sendError(400, split[1]);
|
||||
return;
|
||||
} else {
|
||||
BaseGlobal.getInstance().redisApp.del(RedisKey.Ban_Open_Id, openId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String version = request.getParameter("version");
|
||||
if (version == null) {
|
||||
version="未知版本号";
|
||||
|
@ -72,7 +89,7 @@ public class GetUserController extends HttpServlet {
|
|||
return;
|
||||
}
|
||||
String token = request.getParameter("token");
|
||||
if (token == null || serverId.isEmpty()) {
|
||||
if (token == null || token.isEmpty()) {
|
||||
response.sendError(400, "token is empety");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,4 +15,8 @@ public interface RedisKey {
|
|||
*/
|
||||
String NOTICE = "NOTICE";
|
||||
String GLOBAL_SYS_PRO= "GLOBAL_SYS_PRO";
|
||||
/**
|
||||
* 根据openId 封号
|
||||
*/
|
||||
String Ban_Open_Id = "Ban_Open_Id";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue