Commit 33e8c7ca2e4b3e7579361600ef9c10e47cf1d296
1 parent
668b97e4
【代码评审】MEMBER:完善微信小程序码
Showing
2 changed files
with
2 additions
and
0 deletions
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java
| @@ -71,6 +71,7 @@ public class AppSocialUserController { | @@ -71,6 +71,7 @@ public class AppSocialUserController { | ||
| 71 | public CommonResult<String> getWxQrcode(@RequestBody @Valid AppSocialWxQrcodeReqVO reqVO) { | 71 | public CommonResult<String> getWxQrcode(@RequestBody @Valid AppSocialWxQrcodeReqVO reqVO) { |
| 72 | byte[] wxQrcode = socialClientApi.getWxaQrcode(BeanUtils.toBean(reqVO, SocialWxQrcodeReqDTO.class) | 72 | byte[] wxQrcode = socialClientApi.getWxaQrcode(BeanUtils.toBean(reqVO, SocialWxQrcodeReqDTO.class) |
| 73 | .setEnvVersion(AppSocialWxQrcodeReqVO.ENV_VERSION)); | 73 | .setEnvVersion(AppSocialWxQrcodeReqVO.ENV_VERSION)); |
| 74 | + // TODO @puhui999:1)是不是 base64 返回,不拼接哈 data:image/png;base64;2)cn.hutool.core.codec.Base64.encode() | ||
| 74 | return success("data:image/png;base64," + Base64.getEncoder().encodeToString(wxQrcode)); | 75 | return success("data:image/png;base64," + Base64.getEncoder().encodeToString(wxQrcode)); |
| 75 | } | 76 | } |
| 76 | 77 |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialWxQrcodeReqVO.java
| @@ -10,6 +10,7 @@ import lombok.Data; | @@ -10,6 +10,7 @@ import lombok.Data; | ||
| 10 | public class AppSocialWxQrcodeReqVO { | 10 | public class AppSocialWxQrcodeReqVO { |
| 11 | 11 | ||
| 12 | // TODO @puhui999: 没有默认值 getQrcodeService().createWxaCodeUnlimitBytes() 转类型会报错 🤣 | 12 | // TODO @puhui999: 没有默认值 getQrcodeService().createWxaCodeUnlimitBytes() 转类型会报错 🤣 |
| 13 | + // TODO @puhui999:懂了哈;default 最好在 controller 搞;对于 VO 来说,不给默认值; | ||
| 13 | public static String ENV_VERSION = "release"; // 小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop" | 14 | public static String ENV_VERSION = "release"; // 小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop" |
| 14 | private static String SCENE = ""; // 页面路径不能携带参数(参数请放在scene字段里) | 15 | private static String SCENE = ""; // 页面路径不能携带参数(参数请放在scene字段里) |
| 15 | private static Integer WIDTH = 430; // 二维码宽度 | 16 | private static Integer WIDTH = 430; // 二维码宽度 |