add
yj
2024-12-05 b9900893177c78fc559223521fe839aa21000017
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.dobbinsoft.fw.support.config.captcha;
 
import com.dobbinsoft.fw.support.captcha.AjOpenSourceFwCaptchaClient;
import com.dobbinsoft.fw.support.captcha.FwCaptchaClient;
import com.dobbinsoft.fw.support.captcha.QCloudFwCaptchaClient;
import com.dobbinsoft.fw.support.properties.FwCaptchaProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
 
public class CaptchaConfig {
 
    @Autowired
    private FwCaptchaProperties captchaProperties;
 
    @Bean
    public FwCaptchaClient captchaClient() {
        String enable = captchaProperties.getEnable();
        if ("qcloud".equals(enable)) {
            return new QCloudFwCaptchaClient();
        } else if ("aj".equals(enable)) {
            return new AjOpenSourceFwCaptchaClient();
        }
        return null;
    }
 
}