zhibing.pu
2024-08-19 b9522d131e168a92c88f23e2c0a3a2df079926b4
ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/ValidateCodeHandler.java
@@ -1,6 +1,7 @@
package com.ruoyi.gateway.handler;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
@@ -19,23 +20,18 @@
 * @author ruoyi
 */
@Component
public class ValidateCodeHandler implements HandlerFunction<ServerResponse>
{
    @Autowired
    private ValidateCodeService validateCodeService;
    @Override
    public Mono<ServerResponse> handle(ServerRequest serverRequest)
    {
        AjaxResult ajax;
        try
        {
            ajax = validateCodeService.createCaptcha();
        }
        catch (CaptchaException | IOException e)
        {
            return Mono.error(e);
        }
        return ServerResponse.status(HttpStatus.OK).body(BodyInserters.fromValue(ajax));
    }
public class ValidateCodeHandler implements HandlerFunction<ServerResponse> {
   @Autowired
   private ValidateCodeService validateCodeService;
   @Override
   public Mono<ServerResponse> handle(ServerRequest serverRequest) {
      AjaxResult ajax;
      try {
         ajax = validateCodeService.createCaptcha();
      } catch (CaptchaException | IOException e) {
         return Mono.error(e);
      }
      return ServerResponse.status(HttpStatus.OK).body(BodyInserters.fromValue(ajax));
   }
}