| | |
| | | package com.ruoyi.gateway.config; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import com.google.code.kaptcha.impl.DefaultKaptcha; |
| | | import com.google.code.kaptcha.util.Config; |
| | | |
| | | import static com.google.code.kaptcha.Constants.*; |
| | | |
| | | /** |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | | public class CaptchaConfig |
| | | { |
| | | public class CaptchaConfig { |
| | | @Bean(name = "captchaProducer") |
| | | public DefaultKaptcha getKaptchaBean() |
| | | { |
| | | public DefaultKaptcha getKaptchaBean() { |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | Properties properties = new Properties(); |
| | | // 是否有边框 默认为true 我们可以自己设置yes,no |
| | |
| | | } |
| | | |
| | | @Bean(name = "captchaProducerMath") |
| | | public DefaultKaptcha getKaptchaBeanMath() |
| | | { |
| | | public DefaultKaptcha getKaptchaBeanMath() { |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | Properties properties = new Properties(); |
| | | // 是否有边框 默认为true 我们可以自己设置yes,no |