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( @@ -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',

2
conf/custom_config_tajian.json

@ -9,7 +9,7 @@ @@ -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",

7
themes/tajian/controller/FrontapiController.php

@ -195,6 +195,11 @@ Class FrontApiController extends SiteController { @@ -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 { @@ -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']);

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

@ -36,3 +36,12 @@ eof; @@ -36,3 +36,12 @@ eof;
</div>
</form>
</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 = { @@ -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"

Loading…
Cancel
Save