Browse Source

bug fix: wrong path of task data

master
filesite 8 months ago
parent
commit
fbd08a3b3a
  1. 10
      themes/tajian/controller/FrontapiController.php

10
themes/tajian/controller/FrontapiController.php

@ -220,7 +220,7 @@ Class FrontApiController extends SiteController {
//保存快捷方式 //保存快捷方式
protected function saveUrlShortCut($video_id, $task_url) { protected function saveUrlShortCut($video_id, $task_url) {
$data_dir = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['data_dir']; $data_dir = __DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'] . '/' . FSC::$app['config']['tajian']['data_dir'];
if (!is_dir($data_dir)) { if (!is_dir($data_dir)) {
mkdir($data_dir, 0755, true); mkdir($data_dir, 0755, true);
} }
@ -240,7 +240,7 @@ eof;
//保存描述文件:标题和图片 //保存描述文件:标题和图片
protected function saveDescriptionFiles($video_id, $task_data) { protected function saveDescriptionFiles($video_id, $task_data) {
$data_dir = __DIR__ . '/../../../runtime/' . FSC::$app['config']['tajian']['data_dir']; $data_dir = __DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'] . '/' . FSC::$app['config']['tajian']['data_dir'];
if (!is_dir($data_dir)) { if (!is_dir($data_dir)) {
mkdir($data_dir, 0755, true); mkdir($data_dir, 0755, true);
} }
@ -254,13 +254,13 @@ eof;
//保存图片文件 //保存图片文件
if (!empty($task_data['cover_base64'])) { if (!empty($task_data['cover_base64'])) {
$filepath_cover ="{$data_dir}/{$video_id}.{$task_data['cover_type']}"; $filepath_cover = "{$data_dir}/{$video_id}.{$task_data['cover_type']}";
file_put_contents($filepath_cover, $task_data['cover_base64']); file_put_contents($filepath_cover, $task_data['cover_base64']);
$filepath_desc ="{$data_dir}/{$video_id}_cover.txt"; $filepath_desc = "{$data_dir}/{$video_id}_cover.txt";
file_put_contents($filepath_desc, "{$video_id}.{$task_data['cover_type']}"); file_put_contents($filepath_desc, "{$video_id}.{$task_data['cover_type']}");
}else if (!empty($task_data['cover'])) { }else if (!empty($task_data['cover'])) {
$filepath_desc ="{$data_dir}/{$video_id}_cover.txt"; $filepath_desc = "{$data_dir}/{$video_id}_cover.txt";
file_put_contents($filepath_desc, "{$task_data['cover']}"); file_put_contents($filepath_desc, "{$task_data['cover']}");
} }
}catch(Exception $err) { }catch(Exception $err) {

Loading…
Cancel
Save