Skip to content

Commit b58ccf0

Browse files
author
winjo
committed
fix: file ext judge
1 parent c612ad8 commit b58ccf0

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

packages/core/src/server/file-service/disk-file-system.provider.ts

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,50 @@ export class DiskFileSystemProvider extends FCService implements IDiskFileProvid
4646

4747
static H5VideoExtList = ['mp4', 'ogg', 'webm'];
4848

49+
static BinaryExtList = [
50+
'aac',
51+
'avi',
52+
'bmp',
53+
'flv',
54+
'm1v',
55+
'm2a',
56+
'm2v',
57+
'm3a',
58+
'mid',
59+
'midi',
60+
'mk3d',
61+
'mks',
62+
'mkv',
63+
'mov',
64+
'movie',
65+
'mp2',
66+
'mp2a',
67+
'mp3',
68+
'mp4',
69+
'mp4a',
70+
'mp4v',
71+
'mpe',
72+
'mpeg',
73+
'mpg',
74+
'mpg4',
75+
'mpga',
76+
'oga',
77+
'ogg',
78+
'ogv',
79+
'psd',
80+
'qt',
81+
'spx',
82+
'tga',
83+
'tif',
84+
'tiff',
85+
'wav',
86+
'webm',
87+
'webp',
88+
'wma',
89+
'wmv',
90+
'woff',
91+
];
92+
4993
@Autowired(AppConfig)
5094
appConfig: AppConfig;
5195

@@ -554,10 +598,8 @@ export class DiskFileSystemProvider extends FCService implements IDiskFileProvid
554598

555599
if (['png', 'gif', 'jpg', 'jpeg', 'svg'].indexOf(ext) !== -1) {
556600
type = 'image';
557-
} else if (DiskFileSystemProvider.H5VideoExtList.indexOf(ext) !== -1) {
601+
} else if (DiskFileSystemProvider.BinaryExtList.indexOf(ext) !== -1) {
558602
type = 'video';
559-
} else if (ext && ['xml'].indexOf(ext) === -1) {
560-
type = 'binary';
561603
}
562604

563605
return type;

packages/git/src/git.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export class GitContribution implements ServerAppContribution {
4343
const { gitFileSystem, overlayFileSystem } = await configureFileSystem(this.gitApiService);
4444
rootFS.mount(workspaceDir, overlayFileSystem);
4545
// git 以 /git 作为目录读取只读文件系统数据
46-
rootFS.mount(`/${GIT_ROOT}`, gitFileSystem);
46+
rootFS.mount(GIT_ROOT, gitFileSystem);
4747
}
4848
}

0 commit comments

Comments
 (0)