Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 158fe7ef
authored
Jan 10, 2022
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
上传企微素材中文名称乱码修复
1 parent
7e35e193
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
11 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-admin/src/main/resources/application.yml
linkwe-common/pom.xml
pom.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
158fe7e
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
);
}
}
...
...
linkwe-admin/src/main/resources/application.yml
View file @
158fe7e
...
@@ -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
#链接超时时间
...
...
linkwe-common/pom.xml
View file @
158fe7e
...
@@ -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>
...
...
pom.xml
View file @
158fe7e
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment