优化渠道登录

This commit is contained in:
2026-04-02 11:06:37 +08:00
parent c602c0d67d
commit e93c58c7df

View File

@@ -26,6 +26,12 @@ class Channel extends Backend
protected string|array $quickSearchField = ['id', 'code', 'name'];
/**
* adminTree 为辅助接口,默认权限节点名 game/channel/admintree 往往未在后台录入;
* 与列表权限 game/channel/index 对齐,避免子管理员已勾「渠道管理」仍 401。
*/
protected array $noNeedPermission = ['adminTree'];
protected function initController(WebmanRequest $request): ?Response
{
$this->model = new \app\common\model\GameChannel();
@@ -40,6 +46,10 @@ class Channel extends Backend
$response = $this->initializeBackend($request);
if ($response !== null) return $response;
if (!$this->auth->check('game/channel/index')) {
return $this->error(__('You have no permission'));
}
$channels = Db::name('game_channel')
->field(['id', 'name', 'admin_group_id'])
->order('id', 'asc')