From 1d5e7b5e731ec8e474309fd8886f6f4ad99ec04d Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 5 May 2024 13:59:20 +0000 Subject: [PATCH] improve favorite video add when not logined --- themes/tajian/controller/SiteController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/themes/tajian/controller/SiteController.php b/themes/tajian/controller/SiteController.php index 481f1c7..4f66ae8 100644 --- a/themes/tajian/controller/SiteController.php +++ b/themes/tajian/controller/SiteController.php @@ -175,9 +175,13 @@ Class SiteController extends Controller { public function actionNew() { //判断是否已经登录,自动跳转到自己的添加视频网址 $loginedUser = Common::getUserFromSession(); - if (!empty($loginedUser['username']) && !empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id'])) { - $shareUrl = "/{$loginedUser['username']}/site/new/"; - return $this->redirect($shareUrl); + if (!empty(FSC::$app['config']['multipleUserUriParse']) && empty(FSC::$app['user_id'])) { + if (!empty($loginedUser['username'])) { + $shareUrl = "/{$loginedUser['username']}/site/new/"; + return $this->redirect($shareUrl); + }else { + return $this->redirect(/site/login/); + } } //获取数据