Merge branch 'feature/auth' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
Conflicts: README.mdplp
commit
9630f236f8
@ -1,36 +1,36 @@
|
|||||||
package cn.iocoder.yudao.framework.social.config;
|
package cn.iocoder.yudao.framework.social.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory;
|
import cn.iocoder.yudao.framework.social.core.YudaoAuthRequestFactory;
|
||||||
import com.xingyuv.http.HttpUtil;
|
import com.xingyuv.http.HttpUtil;
|
||||||
import com.xingyuv.http.support.hutool.HutoolImpl;
|
import com.xingyuv.http.support.hutool.HutoolImpl;
|
||||||
import com.xingyuv.jushauth.cache.AuthStateCache;
|
import com.xingyuv.jushauth.cache.AuthStateCache;
|
||||||
import com.xingyuv.justauth.autoconfigure.JustAuthProperties;
|
import com.xingyuv.justauth.autoconfigure.JustAuthProperties;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社交自动装配类
|
* 社交自动装配类
|
||||||
*
|
*
|
||||||
* @author timfruit
|
* @author timfruit
|
||||||
* @date 2021-10-30
|
* @date 2021-10-30
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties(JustAuthProperties.class)
|
@EnableConfigurationProperties(JustAuthProperties.class)
|
||||||
public class YudaoSocialAutoConfiguration {
|
public class YudaoSocialAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Primary
|
@Primary
|
||||||
@ConditionalOnProperty(prefix = "justauth", value = "enabled", havingValue = "true", matchIfMissing = true)
|
@ConditionalOnProperty(prefix = "justauth", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||||
public YudaoAuthRequestFactory yudaoAuthRequestFactory(JustAuthProperties properties, AuthStateCache authStateCache) {
|
public YudaoAuthRequestFactory yudaoAuthRequestFactory(JustAuthProperties properties, AuthStateCache authStateCache) {
|
||||||
// 需要修改 HttpUtil 使用的实现,避免类报错
|
// 需要修改 HttpUtil 使用的实现,避免类报错
|
||||||
HttpUtil.setHttp(new HutoolImpl());
|
HttpUtil.setHttp(new HutoolImpl());
|
||||||
// 创建 YudaoAuthRequestFactory
|
// 创建 YudaoAuthRequestFactory
|
||||||
return new YudaoAuthRequestFactory(properties, authStateCache);
|
return new YudaoAuthRequestFactory(properties, authStateCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue