From f0e8da47b717817224a504e6d139ab7e4eacce5e Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 17 Apr 2024 15:42:16 +0800 Subject: [PATCH] multiple user support for video add --- conf/app.php | 2 +- conf/custom_config_tajian.json | 2 +- themes/tajian/controller/FrontapiController.php | 7 ++++++- themes/tajian/views/site/new.php | 9 +++++++++ www/js/tajian.js | 8 +++++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/conf/app.php b/conf/app.php index cd1fd23..38f6d3b 100644 --- a/conf/app.php +++ b/conf/app.php @@ -108,7 +108,7 @@ $configs = array( 'country' => 'cn', 'lang' => 'zh', 'data_mode' => 'json', - 'notify_url' => 'https://tajian.tv/frontapi/hunotify', + 'notify_domain' => 'https://tajian.tv', 'supportedPlatforms' => array( '抖音' => 'douyin', diff --git a/conf/custom_config_tajian.json b/conf/custom_config_tajian.json index 30deaf4..86fbf7b 100644 --- a/conf/custom_config_tajian.json +++ b/conf/custom_config_tajian.json @@ -9,7 +9,7 @@ "country": "cn", "lang": "zh", "data_mode": "json", - "notify_url": "https://tajian.tv/frontapi/hunotify", + "notify_domain": "https://tajian.tv", "supportedPlatforms": { "抖音": "douyin", diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index c652a34..6b7bff4 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -195,6 +195,11 @@ Class FrontApiController extends SiteController { //提交视频抓取任务到HeroUnion英雄联盟 protected function addHeroUnionTask($shareUrl, $platform) { + $notify_prefix = ''; + if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['user_id'])) { + $notify_prefix = '/' . FSC::$app['user_id']; + } + $heroUnionConfig = FSC::$app['config']['heroUnion']; $params = array( 'uuid' => $heroUnionConfig['uuid'], @@ -204,7 +209,7 @@ Class FrontApiController extends SiteController { 'data_mode' => $heroUnionConfig['data_mode'], 'country' => $heroUnionConfig['country'], 'lang' => $heroUnionConfig['lang'], - 'notify_url' => $heroUnionConfig['notify_url'], + 'notify_url' => $heroUnionConfig['notify_domain'] . $notify_prefix . '/frontapi/hunotify/', ); $params['sign'] = $this->sign($params, $heroUnionConfig['token']); diff --git a/themes/tajian/views/site/new.php b/themes/tajian/views/site/new.php index 5226a4d..50b8a7a 100644 --- a/themes/tajian/views/site/new.php +++ b/themes/tajian/views/site/new.php @@ -36,3 +36,12 @@ eof; + + \ No newline at end of file diff --git a/www/js/tajian.js b/www/js/tajian.js index 81c6c0e..a886d3a 100644 --- a/www/js/tajian.js +++ b/www/js/tajian.js @@ -12,10 +12,16 @@ var taJian = { } }; +//多用户支持 +if (typeof(current_user_id) != 'undefined' && current_user_id) { + for (var apiKey in taJian.apis) { + taJian.apis[apiKey] = '/' + current_user_id + taJian.apis[apiKey]; + } +} + //--v2.0-- // 图片异步加载 if ($("img.lazy").get(0)) { - $("img.lazy").lazyload({ effect: "fadeIn", event: "scroll"