* Fix GET builds and projects of API.

This commit is contained in:
zhujinyong
2021-09-10 10:14:22 +08:00
parent 15c3de1171
commit 798c0b202c
8 changed files with 33 additions and 13 deletions
+2 -1
View File
@@ -623,10 +623,11 @@ class project extends control
public function view($projectID = 0)
{
if(!defined('RUN_MODE') || RUN_MODE != 'api') $projectID = $this->project->saveState((int)$projectID, $this->project->getPairsByProgram());
$project = $this->project->getById($projectID);
if(empty($project) || strpos('scrum,waterfall', $project->model) === false)
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found'));
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
die(js::error($this->lang->notFound) . js::locate('back'));
}