SYSTEM:完善微信小程序码

This commit is contained in:
puhui999
2024-05-27 16:18:52 +08:00
parent 3025bff631
commit ea7f923072
6 changed files with 16 additions and 13 deletions

View File

@ -12,12 +12,6 @@ import lombok.Data;
@Data
public class SocialWxQrcodeReqDTO {
/**
* 小程序版本
*
* 正式版为 "release";体验版为 "trial";开发版为 "develop"
*/
public static final String ENV_VERSION = "release";
/**
* 页面路径不能携带参数参数请放在scene字段里
*/
@ -51,10 +45,6 @@ public class SocialWxQrcodeReqDTO {
*/
@NotEmpty(message = "页面路径不能为空")
private String path;
/**
* 要打开的小程序版本
*/
private String envVersion;
/**
* 二维码宽度
*/

View File

@ -41,6 +41,7 @@ import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@ -60,6 +61,12 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
@Slf4j
public class SocialClientServiceImpl implements SocialClientService {
/**
* 小程序版本
*/
@Value("${yudao.wxa-code.env-version}")
public String envVersion;
@Resource
private AuthRequestFactory authRequestFactory;
@ -237,7 +244,7 @@ public class SocialClientServiceImpl implements SocialClientService {
ObjUtil.defaultIfEmpty(reqVO.getScene(), SocialWxQrcodeReqDTO.SCENE),
reqVO.getPath(),
ObjUtil.defaultIfNull(reqVO.getCheckPath(), SocialWxQrcodeReqDTO.CHECK_PATH),
ObjUtil.defaultIfBlank(reqVO.getEnvVersion(), SocialWxQrcodeReqDTO.ENV_VERSION),
envVersion,
ObjUtil.defaultIfNull(reqVO.getWidth(), SocialWxQrcodeReqDTO.WIDTH),
ObjUtil.defaultIfNull(reqVO.getAutoColor(), SocialWxQrcodeReqDTO.AUTO_COLOR),
null,