* code for task #45184 and adjust api.

This commit is contained in:
王怡栋
2021-11-26 14:18:28 +08:00
parent d41d6cf262
commit 03f1dd727e
52 changed files with 97 additions and 86 deletions
+6 -1
View File
@@ -115,7 +115,11 @@ class file extends control
{
if(session_id() != $this->app->sessionID) helper::restartSession($this->app->sessionID);
$file = $this->file->getById($fileID);
if(empty($file)) die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
if(empty($file))
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => $this->lang->file->fileNotFound));
die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
}
/* Judge the mode, down or open. */
$mode = 'down';
@@ -156,6 +160,7 @@ class file extends control
}
else
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => $this->lang->file->fileNotFound));
die("<html><head><meta charset='utf-8'></head><body>{$this->lang->file->fileNotFound}</body></html>");
}
}