登录增加限流器验证 防止同一IP下 疯狂撞库

v1.4.1
Parker 5 years ago
parent 219d1337ad
commit ff429d04fd

@ -23,6 +23,7 @@ import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.opsli.api.base.result.ResultVo; import org.opsli.api.base.result.ResultVo;
import org.opsli.api.wrapper.system.tenant.TenantModel; import org.opsli.api.wrapper.system.tenant.TenantModel;
import org.opsli.api.wrapper.system.user.UserModel; import org.opsli.api.wrapper.system.user.UserModel;
import org.opsli.common.annotation.limiter.Limiter;
import org.opsli.common.api.TokenThreadLocal; import org.opsli.common.api.TokenThreadLocal;
import org.opsli.common.exception.TokenException; import org.opsli.common.exception.TokenException;
import org.opsli.common.thread.refuse.AsyncProcessQueueReFuse; import org.opsli.common.thread.refuse.AsyncProcessQueueReFuse;
@ -69,6 +70,7 @@ public class LoginRestController {
/** /**
* *
*/ */
@Limiter
@ApiOperation(value = "登录", notes = "登录") @ApiOperation(value = "登录", notes = "登录")
@PostMapping("/sys/login") @PostMapping("/sys/login")
public ResultVo<?> login(@RequestBody LoginForm form, HttpServletRequest request){ public ResultVo<?> login(@RequestBody LoginForm form, HttpServletRequest request){
@ -153,6 +155,7 @@ public class LoginRestController {
/** /**
* *
*/ */
@Limiter
@ApiOperation(value = "获得当前登录失败次数", notes = "获得当前登录失败次数") @ApiOperation(value = "获得当前登录失败次数", notes = "获得当前登录失败次数")
@GetMapping("/sys/slipCount") @GetMapping("/sys/slipCount")
public ResultVo<?> slipCount(String username){ public ResultVo<?> slipCount(String username){
@ -168,6 +171,7 @@ public class LoginRestController {
/** /**
* *
*/ */
@Limiter
@ApiOperation(value = "验证码", notes = "验证码") @ApiOperation(value = "验证码", notes = "验证码")
@GetMapping("captcha.jpg") @GetMapping("captcha.jpg")
public void captcha(String uuid, HttpServletResponse response) throws IOException { public void captcha(String uuid, HttpServletResponse response) throws IOException {

Loading…
Cancel
Save