1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-16 21:26:13 +08:00

统一规范$this->response->redirect

This commit is contained in:
xiaochong0302 2025-01-08 17:32:23 +08:00
parent f273e874e7
commit 2d26c2659b
6 changed files with 26 additions and 13 deletions

View File

@ -16,7 +16,7 @@
</div>
<div class="kg-nav-right">
<a class="layui-btn layui-btn-sm" href="{{ category_url }}">
<i class="layui-icon layui-icon-add-1"></i>分类管理
<i class="layui-icon layui-icon-add-1"></i>课程分类
</a>
<a class="layui-btn layui-btn-sm" href="{{ add_url }}">
<i class="layui-icon layui-icon-add-1"></i>添加课程

View File

@ -27,7 +27,10 @@ class OrderController extends Controller
parent::beforeExecuteRoute($dispatcher);
if ($this->authUser->id == 0) {
$this->response->redirect(['for' => 'home.account.login']);
$dispatcher->forward([
'controller' => 'account',
'action' => 'login',
]);
return false;
}

View File

@ -27,7 +27,10 @@ class PointGiftController extends Controller
parent::beforeExecuteRoute($dispatcher);
if ($this->authUser->id == 0) {
$this->response->redirect(['for' => 'home.account.login']);
$dispatcher->forward([
'controller' => 'account',
'action' => 'login',
]);
return false;
}

View File

@ -24,7 +24,10 @@ class TeacherConsoleController extends Controller
parent::beforeExecuteRoute($dispatcher);
if ($this->authUser->id == 0) {
$this->response->redirect(['for' => 'home.account.login']);
$dispatcher->forward([
'controller' => 'account',
'action' => 'login',
]);
return false;
}

View File

@ -44,7 +44,10 @@ class UserConsoleController extends Controller
parent::beforeExecuteRoute($dispatcher);
if ($this->authUser->id == 0) {
$this->response->redirect(['for' => 'home.account.login']);
$dispatcher->forward([
'controller' => 'account',
'action' => 'login',
]);
return false;
}

View File

@ -15,6 +15,7 @@ use App\Exceptions\Unauthorized as UnauthorizedException;
use App\Library\Logger as AppLogger;
use Phalcon\Config;
use Phalcon\Di\Injectable;
use Throwable;
class HttpErrorHandler extends Injectable
{
@ -25,7 +26,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
public function handleException($e)
{
@ -45,7 +46,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
protected function setStatusCode($e)
{
@ -65,7 +66,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
protected function report($e)
{
@ -86,7 +87,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
protected function apiError($e)
{
@ -98,7 +99,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
protected function ajaxError($e)
{
@ -110,7 +111,7 @@ class HttpErrorHandler extends Injectable
}
/**
* @param \Throwable $e
* @param Throwable $e
*/
protected function pageError($e)
{