fix: 获得微信小程序码(base64 image)

This commit is contained in:
puhui999
2024-05-14 23:28:44 +08:00
parent 4a0ad205ae
commit 4c05bd340e
10 changed files with 33 additions and 38 deletions

View File

@ -4,6 +4,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import org.springframework.stereotype.Service;
@ -40,4 +41,9 @@ public class SocialClientApiImpl implements SocialClientApi {
return BeanUtils.toBean(info, SocialWxPhoneNumberInfoRespDTO.class);
}
@Override
public byte[] getWxaQrcode(SocialWxQrcodeReqDTO reqVO) {
return socialClientService.getWxaQrcode(reqVO);
}
}

View File

@ -43,10 +43,4 @@ public class SocialUserApiImpl implements SocialUserApi {
return socialUserService.getSocialUserByCode(userType, socialType, code, state);
}
// TODO @puhui999貌似搞到 SocialClientApiImpl 更合适,二维码和用户关系不大;这样 socialUserService 也不用绕一次了
@Override
public byte[] getWxQrcode(SocialWxQrcodeReqDTO reqVO) {
return socialUserService.getWxQrcode(reqVO);
}
}

View File

@ -67,7 +67,7 @@ public interface SocialClientService {
* @param reqVO 请求信息
* @return 小程序二维码
*/
byte[] getWxQrcode(SocialWxQrcodeReqDTO reqVO);
byte[] getWxaQrcode(SocialWxQrcodeReqDTO reqVO);
// =================== 客户端管理 ===================

View File

@ -229,7 +229,7 @@ public class SocialClientServiceImpl implements SocialClientService {
}
@Override
public byte[] getWxQrcode(SocialWxQrcodeReqDTO reqVO) {
public byte[] getWxaQrcode(SocialWxQrcodeReqDTO reqVO) {
WxMaService service = getWxMaService(reqVO.getUserType());
try {
return service.getQrcodeService().createWxaCodeUnlimitBytes(reqVO.getScene(), reqVO.getPath(),

View File

@ -87,12 +87,4 @@ public interface SocialUserService {
*/
PageResult<SocialUserDO> getSocialUserPage(SocialUserPageReqVO pageReqVO);
/**
* 获得小程序二维码
*
* @param reqVO 请求信息
* @return 小程序二维码
*/
byte[] getWxQrcode(SocialWxQrcodeReqDTO reqVO);
}

View File

@ -171,9 +171,4 @@ public class SocialUserServiceImpl implements SocialUserService {
return socialUserMapper.selectPage(pageReqVO);
}
@Override
public byte[] getWxQrcode(SocialWxQrcodeReqDTO reqVO) {
return socialClientService.getWxQrcode(reqVO);
}
}