Browse Source

multiple user support for video add

master
filesite 7 months ago
parent
commit
f0e8da47b7
  1. 2
      conf/app.php
  2. 2
      conf/custom_config_tajian.json
  3. 7
      themes/tajian/controller/FrontapiController.php
  4. 9
      themes/tajian/views/site/new.php
  5. 8
      www/js/tajian.js

2
conf/app.php

@ -108,7 +108,7 @@ $configs = array(
'country' => 'cn', 'country' => 'cn',
'lang' => 'zh', 'lang' => 'zh',
'data_mode' => 'json', 'data_mode' => 'json',
'notify_url' => 'https://tajian.tv/frontapi/hunotify', 'notify_domain' => 'https://tajian.tv',
'supportedPlatforms' => array( 'supportedPlatforms' => array(
'抖音' => 'douyin', '抖音' => 'douyin',

2
conf/custom_config_tajian.json

@ -9,7 +9,7 @@
"country": "cn", "country": "cn",
"lang": "zh", "lang": "zh",
"data_mode": "json", "data_mode": "json",
"notify_url": "https://tajian.tv/frontapi/hunotify", "notify_domain": "https://tajian.tv",
"supportedPlatforms": { "supportedPlatforms": {
"抖音": "douyin", "抖音": "douyin",

7
themes/tajian/controller/FrontapiController.php

@ -195,6 +195,11 @@ Class FrontApiController extends SiteController {
//提交视频抓取任务到HeroUnion英雄联盟 //提交视频抓取任务到HeroUnion英雄联盟
protected function addHeroUnionTask($shareUrl, $platform) { 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']; $heroUnionConfig = FSC::$app['config']['heroUnion'];
$params = array( $params = array(
'uuid' => $heroUnionConfig['uuid'], 'uuid' => $heroUnionConfig['uuid'],
@ -204,7 +209,7 @@ Class FrontApiController extends SiteController {
'data_mode' => $heroUnionConfig['data_mode'], 'data_mode' => $heroUnionConfig['data_mode'],
'country' => $heroUnionConfig['country'], 'country' => $heroUnionConfig['country'],
'lang' => $heroUnionConfig['lang'], 'lang' => $heroUnionConfig['lang'],
'notify_url' => $heroUnionConfig['notify_url'], 'notify_url' => $heroUnionConfig['notify_domain'] . $notify_prefix . '/frontapi/hunotify/',
); );
$params['sign'] = $this->sign($params, $heroUnionConfig['token']); $params['sign'] = $this->sign($params, $heroUnionConfig['token']);

9
themes/tajian/views/site/new.php

@ -36,3 +36,12 @@ eof;
</div> </div>
</form> </form>
</main> </main>
<?php
$user_id = '';
if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['user_id'])) {
$user_id = FSC::$app['user_id'];
}
?>
<script>
var current_user_id = '<?=$user_id?>';
</script>

8
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-- //--v2.0--
// 图片异步加载 // 图片异步加载
if ($("img.lazy").get(0)) { if ($("img.lazy").get(0)) {
$("img.lazy").lazyload({ $("img.lazy").lazyload({
effect: "fadeIn", effect: "fadeIn",
event: "scroll" event: "scroll"

Loading…
Cancel
Save