🐛 #3692【小程序】【公众号】修复图片智能裁剪接口请求类型错误的问题

Co-authored-by: dengfeng <dengfeng@huaxincem.com>
This commit is contained in:
dengfengfeng
2025-09-04 09:19:20 +08:00
committed by GitHub
parent 8447caa75f
commit 118839a49d
3 changed files with 5 additions and 5 deletions

View File

@@ -82,7 +82,7 @@ public class WxMaImgProcServiceImpl implements WxImgProcService {
ratios = "";
}
final String result = this.service.get(String.format(AI_CROP, imgUrl, ratios), null);
final String result = this.service.post(String.format(AI_CROP, imgUrl, ratios), "");
return WxImgProcAiCropResult.fromJson(result);
}

View File

@@ -86,8 +86,8 @@ public class WxMpImgProcServiceImpl implements WxImgProcService {
ratios = "";
}
final String result = this.wxMpService.get(String.format(AI_CROP.getUrl(this.wxMpService.getWxMpConfigStorage()),
imgUrl, ratios), null);
final String result = this.wxMpService.post(String.format(AI_CROP.getUrl(this.wxMpService.getWxMpConfigStorage()),
imgUrl, ratios), "");
return WxImgProcAiCropResult.fromJson(result);
}

View File

@@ -61,14 +61,14 @@ public class WxMpImgProcServiceImplTest {
@Test
public void testAiCrop() throws WxErrorException {
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/raw/master/images/qrcodes/mp.png");
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/images/banners/wiki.jpg");
assertThat(result).isNotNull();
System.out.println(result);
}
@Test
public void testAiCrop2() throws WxErrorException {
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/raw/master/images/qrcodes/mp.png", "1,2.35");
final WxImgProcAiCropResult result = this.mpService.getImgProcService().aiCrop("https://gitee.com/binary/weixin-java-tools/images/banners/wiki.jpg", "1,2.35");
assertThat(result).isNotNull();
System.out.println(result);
}