fix - 文件分类
This commit is contained in:
@@ -15,7 +15,6 @@ spring:
|
|||||||
profiles:
|
profiles:
|
||||||
include:
|
include:
|
||||||
-development
|
-development
|
||||||
-test
|
|
||||||
-production
|
-production
|
||||||
active: development
|
active: development
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ spring:
|
|||||||
profiles:
|
profiles:
|
||||||
include:
|
include:
|
||||||
-development
|
-development
|
||||||
-test
|
|
||||||
-production
|
-production
|
||||||
active: development
|
active: development
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class OSSClientUtil {
|
|||||||
boolean uploadResult = ossClient.doesObjectExist(bucketName, backUrl);
|
boolean uploadResult = ossClient.doesObjectExist(bucketName, backUrl);
|
||||||
|
|
||||||
if (uploadResult) {
|
if (uploadResult) {
|
||||||
backUrl = getImgUrl(name);
|
backUrl = getImgUrl(path,name);
|
||||||
} else {
|
} else {
|
||||||
backUrl = "";
|
backUrl = "";
|
||||||
}
|
}
|
||||||
@@ -191,13 +191,12 @@ public class OSSClientUtil {
|
|||||||
/**
|
/**
|
||||||
* 获得图片路径
|
* 获得图片路径
|
||||||
*
|
*
|
||||||
* @param fileUrl
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getImgUrl(String fileUrl) {
|
public String getImgUrl(String filePath,String filename) {
|
||||||
if (!StringUtils.isEmpty(fileUrl)) {
|
if (!StringUtils.isEmpty(filename)) {
|
||||||
String[] split = fileUrl.split("/");
|
String[] split = filename.split("/");
|
||||||
return url + this.imageDir + split[split.length - 1];
|
return url + filePath + split[split.length - 1];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user