diff --git a/CHANGELOG.md b/CHANGELOG.md index b2af237b..2177671d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### [v1.6.6](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.6)(2023-08-15) + ### [v1.6.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.6.5)(2023-07-15) - 升级layui-v2.8.8 diff --git a/app/Http/Admin/Controllers/SessionController.php b/app/Http/Admin/Controllers/SessionController.php index e554bf05..85d09e53 100644 --- a/app/Http/Admin/Controllers/SessionController.php +++ b/app/Http/Admin/Controllers/SessionController.php @@ -34,15 +34,13 @@ class SessionController extends \Phalcon\Mvc\Controller return $this->response->redirect(['for' => 'admin.index']); } - $sessionService = new SessionService(); - - $captcha = $sessionService->getSettings('captcha'); - if ($this->request->isPost()) { $this->checkHttpReferer(); $this->checkCsrfToken(); + $sessionService = new SessionService(); + $sessionService->login(); $location = $this->url->get(['for' => 'admin.index']); @@ -54,7 +52,6 @@ class SessionController extends \Phalcon\Mvc\Controller $this->view->pick('public/login'); $this->view->setVar('app_info', $appInfo); - $this->view->setVar('captcha', $captcha); } /** diff --git a/app/Http/Admin/Services/Session.php b/app/Http/Admin/Services/Session.php index 53978d19..232ca195 100644 --- a/app/Http/Admin/Services/Session.php +++ b/app/Http/Admin/Services/Session.php @@ -9,7 +9,6 @@ namespace App\Http\Admin\Services; use App\Services\Auth\Admin as AdminAuth; use App\Validators\Account as AccountValidator; -use App\Validators\Captcha as CaptchaValidator; class Session extends Service { @@ -34,18 +33,6 @@ class Session extends Service $validator->checkIfAllowLogin($user); - $captcha = $this->getSettings('captcha'); - - /** - * 验证码是一次性的,放到最后检查,减少第三方调用 - */ - if ($captcha['enabled'] == 1) { - - $validator = new CaptchaValidator(); - - $validator->checkCode($post['captcha']['ticket'], $post['captcha']['rand']); - } - $this->auth->saveAuthInfo($user); $this->eventsManager->fire('Account:afterLogin', $this, $user); diff --git a/app/Http/Admin/Services/Topic.php b/app/Http/Admin/Services/Topic.php index 23195a4b..0c9310b7 100644 --- a/app/Http/Admin/Services/Topic.php +++ b/app/Http/Admin/Services/Topic.php @@ -68,9 +68,9 @@ class Topic extends Service $page = $pagerQuery->getPage(); $limit = $pagerQuery->getLimit(); - $pageRepo = new TopicRepo(); + $topicRepo = new TopicRepo(); - return $pageRepo->paginate($params, $sort, $page, $limit); + return $topicRepo->paginate($params, $sort, $page, $limit); } public function getTopic($id) diff --git a/app/Http/Admin/Views/public/login.volt b/app/Http/Admin/Views/public/login.volt index 72f0f2e3..60bfce0d 100644 --- a/app/Http/Admin/Views/public/login.volt +++ b/app/Http/Admin/Views/public/login.volt @@ -2,9 +2,6 @@ {% block content %} - {% set disabled_submit = captcha.enabled == 1 ? 'disabled="disabled"' : '' %} - {% set disabled_class = captcha.enabled == 1 ? 'layui-btn-disabled' : '' %} -
后台登录
@@ -12,26 +9,15 @@ @@ -74,7 +60,6 @@ {{ js_include('lib/jquery.min.js') }} {{ js_include('lib/jquery.buoyant.min.js') }} - {{ js_include('https://ssl.captcha.qq.com/TCaptcha.js', false) }} {% endblock %} @@ -87,7 +72,7 @@ - - {% endblock %} \ No newline at end of file diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index 5a3db91c..db1f3483 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -16,7 +16,7 @@ class AppInfo protected $link = 'https://www.koogua.com'; - protected $version = '1.6.5'; + protected $version = '1.6.6'; public function __get($name) { diff --git a/app/Traits/Auth.php b/app/Traits/Auth.php index 920cd1b2..553385d5 100644 --- a/app/Traits/Auth.php +++ b/app/Traits/Auth.php @@ -30,7 +30,7 @@ trait Auth return $this->getGuestUser(); } - if ($cache == false) { + if (!$cache) { $userRepo = new UserRepo(); $user = $userRepo->findById($authUser['id']); } else { @@ -54,7 +54,7 @@ trait Auth $validator->checkAuthUser($authUser['id']); - if ($cache == false) { + if (!$cache) { $userRepo = new UserRepo(); $user = $userRepo->findById($authUser['id']); } else { @@ -74,6 +74,7 @@ trait Auth $user->id = 0; $user->name = 'guest'; + $user->avatar = kg_cos_user_avatar_url(null); return $user; }