移除渠道管理
This commit is contained in:
@@ -10,7 +10,6 @@ use app\common\controller\Api;
|
||||
use app\common\facade\Token;
|
||||
use app\common\library\Auth as UserAuth;
|
||||
use app\common\library\AgentJwt;
|
||||
use app\common\model\ChannelManage;
|
||||
use app\common\model\MallPlayxUserAsset;
|
||||
use app\admin\model\Admin;
|
||||
use Webman\Http\Request;
|
||||
@@ -72,17 +71,12 @@ class Auth extends Api
|
||||
return $this->error(__('Agent not found'));
|
||||
}
|
||||
|
||||
$channelId = intval($admin->channel_id ?? 0);
|
||||
if ($channelId <= 0) {
|
||||
$apiSecret = strval($admin->agent_api_secret ?? '');
|
||||
if ($apiSecret === '') {
|
||||
return $this->error(__('Agent not found'));
|
||||
}
|
||||
|
||||
$channel = ChannelManage::where('id', $channelId)->find();
|
||||
if (!$channel || $channel->secret === '') {
|
||||
return $this->error(__('Agent not found'));
|
||||
}
|
||||
|
||||
if ($channel->secret !== $secret) {
|
||||
if ($apiSecret !== $secret) {
|
||||
return $this->error(__('Invalid agent or secret'));
|
||||
}
|
||||
|
||||
@@ -93,9 +87,8 @@ class Auth extends Api
|
||||
|
||||
$expire = intval(config('buildadmin.agent_auth.token_expire', 86400));
|
||||
$payload = [
|
||||
'agent_id' => $agentId,
|
||||
'channel_id' => $channel->id,
|
||||
'admin_id' => $admin->id,
|
||||
'agent_id' => $agentId,
|
||||
'admin_id' => $admin->id,
|
||||
];
|
||||
$authtoken = AgentJwt::encode($payload, $expire);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user