代码优化

This commit is contained in:
wong
2026-01-17 15:58:57 +08:00
parent 56d5f0b5a3
commit 9b8f3b1b2b

View File

@@ -18,7 +18,7 @@ class MessageController extends BaseController
public function getFriendsList($pageIndex = '',$pageSize = '',$isInner = false)
{
// 获取授权token
$authorization = trim($this->request->header('authorization', $this->authorization));
$authorization = $this->authorization;
if (empty($authorization)) {
if($isInner){
return json_encode(['code'=>500,'msg'=>'缺少授权信息']);
@@ -122,7 +122,7 @@ class MessageController extends BaseController
public function getMessageList()
{
// 获取授权token
$authorization = trim($this->request->header('authorization', $this->authorization));
$authorization = $this->authorization;
if (empty($authorization)) {
return errorJson('缺少授权信息');
}
@@ -181,7 +181,7 @@ class MessageController extends BaseController
public function getChatroomList($pageIndex = '',$pageSize = '',$isInner = false)
{
// 获取授权token
$authorization = trim($this->request->header('authorization', $this->authorization));
$authorization = $this->authorization;
if (empty($authorization)) {
if($isInner){
return json_encode(['code'=>500,'msg'=>'缺少授权信息']);
@@ -287,7 +287,7 @@ class MessageController extends BaseController
public function getChatroomMessages()
{
// 获取授权token
$authorization = trim($this->request->header('authorization', $this->authorization));
$authorization = $this->authorization;
if (empty($authorization)) {
return errorJson('缺少授权信息');
}