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 407f5b4f
authored
Jul 13, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改图片上传,素材发送,图片群发等BUG
1 parent
a1f87c10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/common/CommonController.java
linkwe-common/src/main/java/com/linkwechat/common/core/domain/FileVo.java
linkwe-framework/src/main/java/com/linkwechat/framework/web/service/FileService.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/common/CommonController.java
View file @
407f5b4
...
@@ -5,6 +5,7 @@ import com.linkwechat.common.config.RuoYiConfig;
...
@@ -5,6 +5,7 @@ import com.linkwechat.common.config.RuoYiConfig;
import
com.linkwechat.common.config.ServerConfig
;
import
com.linkwechat.common.config.ServerConfig
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.FileVo
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.file.FileUploadUtils
;
import
com.linkwechat.common.utils.file.FileUploadUtils
;
import
com.linkwechat.common.utils.file.FileUtils
;
import
com.linkwechat.common.utils.file.FileUtils
;
...
@@ -123,10 +124,12 @@ public class CommonController {
...
@@ -123,10 +124,12 @@ public class CommonController {
try
{
try
{
SysFile
sysFile
SysFile
sysFile
=
fileService
.
upload
(
file
);
=
fileService
.
upload
(
file
);
AjaxResult
ajax
=
AjaxResult
.
success
();
return
AjaxResult
.
success
(
ajax
.
put
(
"fileName"
,
sysFile
.
getFileName
());
FileVo
.
builder
()
ajax
.
put
(
"url"
,
sysFile
.
getImgUrlPrefix
()+
sysFile
.
getFileName
());
.
fileName
(
sysFile
.
getFileName
())
return
ajax
;
.
url
(
sysFile
.
getImgUrlPrefix
()+
sysFile
.
getFileName
())
.
build
()
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
AjaxResult
.
error
(
e
.
getMessage
());
return
AjaxResult
.
error
(
e
.
getMessage
());
}
}
...
...
linkwe-common/src/main/java/com/linkwechat/common/core/domain/FileVo.java
0 → 100644
View file @
407f5b4
package
com
.
linkwechat
.
common
.
core
.
domain
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.experimental.SuperBuilder
;
/**
* @description:
* @author: HaoN
* @create: 2021-07-13 15:25
**/
@Data
@Builder
public
class
FileVo
{
private
String
fileName
;
private
String
url
;
}
linkwe-framework/src/main/java/com/linkwechat/framework/web/service/FileService.java
View file @
407f5b4
...
@@ -48,7 +48,7 @@ public class FileService {
...
@@ -48,7 +48,7 @@ public class FileService {
if
(
ruoYiConfig
.
getFile
().
isStartCosUpload
()){
//开启云上传
if
(
ruoYiConfig
.
getFile
().
isStartCosUpload
()){
//开启云上传
//开启云上传开关则云上传,不然上传本地
//开启云上传开关则云上传,不然上传本地
fileName
=
FileUploadUtils
.
upload2Cos
(
file
,
ruoYiConfig
.
getFile
().
getCos
());
fileName
=
FileUploadUtils
.
upload2Cos
(
file
,
ruoYiConfig
.
getFile
().
getCos
());
imgUrlPrefix
=
ruoYiConfig
.
getFile
().
getCos
().
getCosImgUrlPrefix
();
imgUrlPrefix
=
ruoYiConfig
.
getFile
().
getCos
().
getCosImgUrlPrefix
();
}
else
{
//本地上传
}
else
{
//本地上传
File
osFile
=
OsUtils
.
isWindows
()?
new
File
(
WINDOWSFILEPATH
):
new
File
(
LINUXFILEPATH
);
File
osFile
=
OsUtils
.
isWindows
()?
new
File
(
WINDOWSFILEPATH
):
new
File
(
LINUXFILEPATH
);
if
(!
osFile
.
exists
()){
if
(!
osFile
.
exists
()){
...
...
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