|
@@ -6,6 +6,7 @@ import com.obs.services.model.PutObjectResult;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
+import java.net.URLDecoder;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
public class HuaWeiObsUtil {
|
|
public class HuaWeiObsUtil {
|
|
@@ -34,7 +35,7 @@ public class HuaWeiObsUtil {
|
|
}
|
|
}
|
|
// 上传文件
|
|
// 上传文件
|
|
PutObjectResult putObjectResult = obsClient.putObject(bucketName, filePath, new ByteArrayInputStream(bytes));
|
|
PutObjectResult putObjectResult = obsClient.putObject(bucketName, filePath, new ByteArrayInputStream(bytes));
|
|
- return putObjectResult.getObjectUrl();
|
|
|
|
|
|
+ return URLDecoder.decode(putObjectResult.getObjectUrl(),"UTF-8");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("上传文件到华为云OBS失败", e);
|
|
log.error("上传文件到华为云OBS失败", e);
|
|
}
|
|
}
|