feat: 重构微信小程序登录模块

This commit is contained in:
Ray.Hao
2026-03-06 23:23:55 +08:00
parent 27a8f0e6a5
commit e69baa6785
15 changed files with 492 additions and 164 deletions

View File

@@ -0,0 +1,38 @@
package com.youlai.boot.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import com.youlai.boot.config.property.WxMaProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 微信小程序配置
*
* @author Ray.Hao
* @since 2024/01/01
*/
@Configuration
@EnableConfigurationProperties(WxMaProperties.class)
public class WxMaConfig {
/**
* 微信小程序服务
*
* @param properties 微信小程序配置属性
* @return {@link WxMaService}
*/
@Bean
public WxMaService wxMaService(WxMaProperties properties) {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(properties.getAppid());
config.setSecret(properties.getSecret());
WxMaService service = new WxMaServiceImpl();
service.setWxMaConfig(config);
return service;
}
}