From 467753c2fa1347e693fd57bf4f6b7c16c170d995 Mon Sep 17 00:00:00 2001 From: filesite Date: Thu, 6 Jun 2024 08:09:49 +0800 Subject: [PATCH] vip rights update --- conf/app.php | 3 ++- .../tajian/controller/FrontapiController.php | 18 +++++++--------- themes/tajian/controller/MyController.php | 21 +++++++++---------- themes/tajian/views/my/createdir.php | 12 +++++------ themes/tajian/views/my/sharedir.php | 4 ---- themes/tajian/views/site/new.php | 4 +++- 6 files changed, 29 insertions(+), 33 deletions(-) diff --git a/conf/app.php b/conf/app.php index 21671ac..80ec874 100644 --- a/conf/app.php +++ b/conf/app.php @@ -64,7 +64,8 @@ $configs = array( 'tag_dir' => 'tags/', //tag分类目录 'task_dir' => 'task/', //分享视频下载任务文件保存目录 'task_log' => 'tasks.log', //分享视频下载任务文件日志文件 - 'max_dir_num' => 20, //一个手机可创建的最大收藏夹数量 + 'max_dir_num' => 3, //普通用户:一个手机可创建的最大收藏夹数量 + 'max_dir_num_vip' => 50, //VIP用户:一个手机可创建的最大收藏夹数量 'supportedPlatforms' => array( 'B站', '抖音', diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 9e8d510..4b87cac 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -1208,9 +1208,7 @@ eof; } //VIP身份判断 - if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) { - throw new Exception('Oops,你还不是VIP,请联系首页底部客服邮箱开通。'); - } + $isVipUser = Common::isVipUser($loginedUser); //返回给视图的变量 @@ -1231,8 +1229,13 @@ eof; if (empty($err)) { //如果数据检查通过,尝试保存 //已经创建的收藏夹数量检查 - //每个手机号最多创建 20 个收藏夹 - $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 10; + //普通用户:每个手机号最多创建 3 个收藏夹 + $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 3; + //VIP用户:每个手机号最多创建 20 个收藏夹 + if ($isVipUser) { //vip用户判断 + $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num_vip']) ? FSC::$app['config']['tajian']['max_dir_num_vip'] : 20; + } + $myDirs = Common::getMyDirs($loginedUser['cellphone'], $loginedUser['username']); if (count($myDirs) >= $max_num) { $err = "你已经创建了 {$max_num} 个账号,已达到最大数量"; @@ -1276,11 +1279,6 @@ eof; throw new Exception('Oops,请求地址有误'); } - //VIP身份判断 - if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) { - throw new Exception('Oops,你还不是VIP,请联系首页底部客服邮箱开通。'); - } - //返回给视图的变量 $code = 0; diff --git a/themes/tajian/controller/MyController.php b/themes/tajian/controller/MyController.php index edc6aa2..60093b7 100644 --- a/themes/tajian/controller/MyController.php +++ b/themes/tajian/controller/MyController.php @@ -148,14 +148,19 @@ Class MyController extends SiteController { public function actionCreatedir() { //VIP身份判断 $loginedUser = Common::getUserFromSession(); - $isVipUser = true; - if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) { - $isVipUser = false; + $isVipUser = Common::isVipUser($loginedUser); + + //普通用户:每个手机号最多创建 3 个收藏夹 + $max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 3; + $max_num_vip = 20; + //VIP用户:每个手机号最多创建 20 个收藏夹 + if ($isVipUser) { //vip用户判断 + $max_num = $max_num_vip = !empty(FSC::$app['config']['tajian']['max_dir_num_vip']) ? FSC::$app['config']['tajian']['max_dir_num_vip'] : 20; } $defaultTitle = "添加账号"; $viewName = 'createdir'; - return $this->actionIndex($viewName, $defaultTitle, compact('isVipUser')); + return $this->actionIndex($viewName, $defaultTitle, compact('isVipUser', 'max_num', 'max_num_vip')); } //共享收藏夹 @@ -175,15 +180,9 @@ Class MyController extends SiteController { $myShareDirs = Common::getMyShareDirs($loginedUser['cellphone'], $loginedUser['username']); - //VIP身份判断 - $isVipUser = true; - if (empty($loginedUser['cellphone']) || !in_array($loginedUser['cellphone'], FSC::$app['config']['tajian_vip_user'])) { - $isVipUser = false; - } - $defaultTitle = "共享账号"; $viewName = 'sharedir'; - return $this->actionIndex($viewName, $defaultTitle, compact('myDirs', 'myNicks', 'isMine', 'myShareDirs', 'isVipUser')); + return $this->actionIndex($viewName, $defaultTitle, compact('myDirs', 'myNicks', 'isMine', 'myShareDirs')); } } \ No newline at end of file diff --git a/themes/tajian/views/my/createdir.php b/themes/tajian/views/my/createdir.php index 3946c79..adbfc86 100644 --- a/themes/tajian/views/my/createdir.php +++ b/themes/tajian/views/my/createdir.php @@ -5,20 +5,20 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use $linkPrefix = '/' . FSC::$app['user_id']; } -$max_num = !empty(FSC::$app['config']['tajian']['max_dir_num']) ? FSC::$app['config']['tajian']['max_dir_num'] : 10; ?>
- -
此功能限VIP使用,限时免费开通请联系客服哦
- -
-

说明:
一个手机号码最多添加 个账号。

+

+ 说明: +
+ VIP可以添加 个账号, + 当前可添加 个账号。 +

- -
此功能限VIP使用,限时免费开通请联系客服哦
- -
diff --git a/themes/tajian/views/site/new.php b/themes/tajian/views/site/new.php index 9c18c64..6ef771c 100644 --- a/themes/tajian/views/site/new.php +++ b/themes/tajian/views/site/new.php @@ -9,7 +9,9 @@ $supportPlatforms = FSC::$app['config']['tajian']['supportedPlatforms']; echo implode(',', array_slice($supportPlatforms, 0, -1)); ?> - ,如需支持其它平台或任意网址,以及搭建视频分享网站,请 Email联系。 +
+ VIP可收藏任意网址,开通VIP、搭建视频网站 + 👉Email联系