Skip to content

Commit cd94435

Browse files
committed
fix oss prefix
1 parent 61d4c7a commit cd94435

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

core/utils/common.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,12 @@ common.uploadFileToOSS = function (key, filePath) {
259259
endpoint: _.get(config, 'oss.endpoint'),
260260
apiVersion: '2013-10-15',
261261
}));
262+
if (!_.isEmpty(_.get(config, 'oss.prefix', ""))) {
263+
key = `${_.get(config, 'oss.prefix')}/${key}`;
264+
}
262265
var upload = ossStream.upload({
263266
Bucket: _.get(config, 'oss.bucketName'),
264-
Key: `${_.get(config, 'oss.prefix')}/${key}`,
267+
Key: key,
265268
});
266269

267270
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)