feat: 屏蔽选择网站运行目录中,辅助开发包目录 (#5657)

Refs #4242
This commit is contained in:
John Bro 2024-07-03 15:05:29 +08:00 committed by GitHub
parent 5426c4ea68
commit 1e553fc14e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,10 +161,17 @@ const initData = () => {
dirs.value = [];
};
function filterDirectories(directories: any[]) {
return directories.filter((dir) => {
return !dir.startsWith('/node_modules') && !dir.startsWith('/vendor');
});
}
const getDirConfig = async () => {
try {
const res = await GetDirConfig({ id: props.id });
dirs.value = res.data.dirs;
dirs.value = filterDirectories(dirs.value);
dirConfig.value = res.data;
} catch (error) {}
};