Commit 158fe7ef by danmo

上传企微素材中文名称乱码修复

1 parent 7e35e193
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.annotation.Log; import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController; import com.linkwechat.common.core.controller.BaseController;
...@@ -138,14 +139,10 @@ public class WeMaterialController extends BaseController { ...@@ -138,14 +139,10 @@ public class WeMaterialController extends BaseController {
@GetMapping("/temporaryMaterialMediaId") @GetMapping("/temporaryMaterialMediaId")
@ApiOperation("H5端发送获取素材media_id") @ApiOperation("H5端发送获取素材media_id")
public AjaxResult temporaryMaterialMediaId(String url,String type,String name) throws UnsupportedEncodingException { public AjaxResult temporaryMaterialMediaId(String url,String type,String name) throws UnsupportedEncodingException {
String suffix = FileUtil.getSuffix(url);
// Base64.Encoder encoder = Base64.getEncoder(); String prefixName = FileUtil.getPrefix(name);
// byte[] textByte = name.getBytes("UTF-8"); String tempFileName = prefixName+"."+suffix;
// String encodedText = encoder.encodeToString(textByte); WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(url, type,tempFileName);
WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(url,
type
, name+"."+url .substring( url .lastIndexOf(".") + 1, url.length()));
return AjaxResult.success(weMediaDto); return AjaxResult.success(weMediaDto);
} }
......
...@@ -242,7 +242,7 @@ xss: ...@@ -242,7 +242,7 @@ xss:
# forest配置 # forest配置
forest: forest:
backend: httpclient backend: okhttp3
max-retry-count: 3 # 请求失败后重试次数,默认为0次不重试 max-retry-count: 3 # 请求失败后重试次数,默认为0次不重试
max-retry-interval: 1000 #重试间隔时间 max-retry-interval: 1000 #重试间隔时间
connect-timeout: 3000 #链接超时时间 connect-timeout: 3000 #链接超时时间
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<dependency> <dependency>
<groupId>com.dtflys.forest</groupId> <groupId>com.dtflys.forest</groupId>
<artifactId>forest-spring-boot-starter</artifactId> <artifactId>forest-spring-boot-starter</artifactId>
<version>1.5.5</version> <version>1.5.16</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<poi.version>3.17</poi.version> <poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<jwt.version>0.9.0</jwt.version> <jwt.version>0.9.0</jwt.version>
<forest.version>1.5.5</forest.version> <forest.version>1.5.16</forest.version>
<lombok.version>1.18.16</lombok.version> <lombok.version>1.18.16</lombok.version>
<reflectasm.version>1.11.9</reflectasm.version> <reflectasm.version>1.11.9</reflectasm.version>
<hutool.version>5.4.1</hutool.version> <hutool.version>5.4.1</hutool.version>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!