1
This commit is contained in:
@@ -10,12 +10,15 @@ const logs = require('../middleware/logProxy')
|
||||
*/
|
||||
class OSSToolService {
|
||||
constructor() {
|
||||
const { accessKeyId, accessKeySecret, bucket, region } = config.oos;
|
||||
const { accessKeyId, accessKeySecret, bucket, region, timeout } = config.oos;
|
||||
// 设置超时时间:默认30分钟(1800000ms),适用于大文件上传
|
||||
// 可以从配置文件读取,如果没有配置则使用默认值
|
||||
this.client = new OSS({
|
||||
region,
|
||||
accessKeyId,
|
||||
accessKeySecret,
|
||||
bucket,
|
||||
timeout: timeout || 30 * 60 * 1000, // 30分钟超时(1800000ms)
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ module.exports = {
|
||||
"accessKeyId": "LTAI5tENEdLxFU7Ne9wGazsk",
|
||||
"accessKeySecret": "nvfvDfz2tLcOH8XE3EQpXsnBFpVyK5",
|
||||
region: 'oss-cn-beijing',
|
||||
bucket: 'light22600'
|
||||
bucket: 'light22600',
|
||||
timeout: 30 * 60 * 1000 // OSS 请求超时时间:30分钟(适用于大文件上传)
|
||||
},
|
||||
|
||||
// 分页配置
|
||||
|
||||
Reference in New Issue
Block a user