feat: 检查应用是否已安装

This commit is contained in:
王昱
2025-05-23 12:40:33 +08:00
parent 6e03a05e6d
commit 1d92c2668d
7 changed files with 92 additions and 13 deletions

View File

@@ -41,6 +41,7 @@ use App\Models\ProjectTaskFlowChange;
use App\Models\ProjectTaskVisibilityUser;
use App\Models\ProjectTaskTemplate;
use App\Models\ProjectTag;
use App\Module\Apps;
/**
* @apiDefine project
@@ -1831,6 +1832,18 @@ class ProjectController extends AbstractController
'update_at' => Carbon::parse($file->updated_at)->toDateTimeString()
]);
}
// office
if (in_array($file->ext, ['docx', 'xlsx', 'pptx']) && !Apps::isInstalled('office')) {
return Base::retError('应用「OnlyOffice」未安装');
}
// drawio
if ($file->ext == 'drawio' && !Apps::isInstalled('drawio')) {
return Base::retError('应用「Drawio」未安装');
}
// mind
if ($file->ext == 'mind' && !Apps::isInstalled('minder')) {
return Base::retError('应用「Minder」未安装');
}
//
$data = $file->toArray();
$data['path'] = $file->getRawOriginal('path');