diff --git a/conf/app.php b/conf/app.php index 38f6d3b..526f914 100644 --- a/conf/app.php +++ b/conf/app.php @@ -100,6 +100,7 @@ $configs = array( ), //对接HeroUnion英雄联盟,实现提交任务和接收任务完成回调通知 + 'heroUnionEnable' => false, 'heroUnion' => array( 'server_url' => 'https://herounion.filesite.io', 'uuid' => 'machete_tajian', diff --git a/conf/custom_config_tajian.json b/conf/custom_config_tajian.json index 86fbf7b..74cb3d6 100644 --- a/conf/custom_config_tajian.json +++ b/conf/custom_config_tajian.json @@ -1,6 +1,7 @@ { - "theme":"tajian", - "content_directory":"tajian/", + "theme": "tajian", + "content_directory": "tajian/", + "heroUnionEnable": true, "heroUnion": { "server_url": "https://herounion.filesite.io", "uuid": "machete_tajian", diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 6b7bff4..8eadb2c 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -140,9 +140,11 @@ Class FrontApiController extends SiteController { } //调用HeroUnion联盟接口,提交新的数据抓取任务 - $platformName = Html::getShareVideosPlatform($shareUrl); - $heroUnionConfig = FSC::$app['config']['heroUnion']; - $this->addHeroUnionTask($shareUrl, $heroUnionConfig['supportedPlatforms'][$platformName]); + if (!empty(FSC::$app['config']['heroUnionEnable'])) { + $platformName = Html::getShareVideosPlatform($shareUrl); + $heroUnionConfig = FSC::$app['config']['heroUnion']; + $this->addHeroUnionTask($shareUrl, $heroUnionConfig['supportedPlatforms'][$platformName]); + } } return $done;