File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,11 @@ export default class XCrawl {
146
146
const { id, headers, data } = requestResItem
147
147
148
148
const mimeType = headers [ 'content-type' ] ?? ''
149
- const suffix = mimeType . split ( '/' ) . pop ( )
149
+ const fileExtension = fileConfig . extension ?? mimeType . split ( '/' ) . pop ( )
150
150
const fileName = new Date ( ) . getTime ( ) . toString ( )
151
151
const filePath = path . resolve (
152
152
fileConfig . storeDir ,
153
- `${ fileName } .${ suffix } `
153
+ `${ fileName } .${ fileExtension } `
154
154
)
155
155
156
156
try {
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export interface IFetchDataConfig extends IFetchBaseConifg {}
77
77
export interface IFetchFileConfig extends IFetchBaseConifg {
78
78
fileConfig : {
79
79
storeDir : string
80
+ extension ?: string
80
81
}
81
82
}
82
83
You can’t perform that action at this time.
0 commit comments