页面稍微适配下移动端
新增登陆验证码一分钟内只能尝试三次
This commit is contained in:
@@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ToolsApplication {
|
||||
public static final String version="1.0.17";
|
||||
public static final String version="1.0.18";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("当前版本号:"+version);
|
||||
|
||||
@@ -124,8 +124,22 @@ public class userController {
|
||||
|
||||
@RequestMapping(value = "/login/login.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String login(HttpServletResponse response, String code) {
|
||||
public String login(HttpServletRequest request,HttpServletResponse response, String code) {
|
||||
JSONObject json = new JSONObject();
|
||||
String ip=Tools.getRemoteAddress(request);
|
||||
if(RedisTools.get(ip)==null||"-999".equals(ip)){
|
||||
RedisTools.set(ip,"1",60);
|
||||
}else{
|
||||
int i=Integer.parseInt(RedisTools.get(ip));
|
||||
if(i!=3){
|
||||
i++;
|
||||
RedisTools.set(ip,i+"",60);
|
||||
}else{
|
||||
json.put("code", -2);
|
||||
json.put("msg", "请求频繁,请稍后再试");
|
||||
return json.toJSONString();
|
||||
}
|
||||
}
|
||||
String secret= (String) ConfigTools.load(ConfigTools.DATA,"secret");
|
||||
if(StringUtils.isEmpty(secret)){
|
||||
secret= (String) ConfigTools.load(ConfigTools.DATA,"secret_tmp");
|
||||
|
||||
Reference in New Issue
Block a user