add
This commit is contained in:
@@ -53,19 +53,23 @@ class BaseController
|
|||||||
if(!$this->auth->init($token)) {
|
if(!$this->auth->init($token)) {
|
||||||
$this->error('Token expiration', [], 409);
|
$this->error('Token expiration', [], 409);
|
||||||
}
|
}
|
||||||
};
|
}else {
|
||||||
|
if ($needLogin) {
|
||||||
if ($needLogin) {
|
|
||||||
$this->error('Token expiration', [], 409);
|
|
||||||
}
|
|
||||||
if ($needLogin) {
|
|
||||||
if (!$this->auth->isLogin()) {
|
|
||||||
$this->error('请登录', [
|
$this->error('请登录', [
|
||||||
'type' => $this->auth::NEED_LOGIN
|
'type' => $this->auth::NEED_LOGIN
|
||||||
], $this->auth::LOGIN_RESPONSE_CODE);
|
], $this->auth::LOGIN_RESPONSE_CODE);
|
||||||
}
|
}
|
||||||
|
if ($needLogin) {
|
||||||
|
if (!$this->auth->isLogin()) {
|
||||||
|
$this->error('请登录', [
|
||||||
|
'type' => $this->auth::NEED_LOGIN
|
||||||
|
], $this->auth::LOGIN_RESPONSE_CODE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ use think\facade\Db;
|
|||||||
class CourseController extends BaseController
|
class CourseController extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected array $noNeedLogin = ['*'];
|
|
||||||
public function courseSets()
|
public function courseSets()
|
||||||
{
|
{
|
||||||
$get = $this->request->get();
|
$get = $this->request->get();
|
||||||
|
|||||||
@@ -265,7 +265,6 @@ if (!function_exists('action_in_arr')) {
|
|||||||
function action_in_arr(array $arr = []): bool
|
function action_in_arr(array $arr = []): bool
|
||||||
{
|
{
|
||||||
$arr = is_array($arr) ? $arr : explode(',', $arr);
|
$arr = is_array($arr) ? $arr : explode(',', $arr);
|
||||||
|
|
||||||
if (!$arr) {
|
if (!$arr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user