logic = new MediaListLogic(); parent::__construct(); } /** * https://api.com/MediaOAuth/callback/{channel} */ public function callback(Request $request, string $channel): Response { $callback = $request->get(); $channel = ucfirst($channel); // 如 "toutiao" → "Toutiao"" $channelClass = "app\\adapter\\{$channel}Adapter"; // 适配器类名 $oathInfo = (new $channelClass)->OAuth($callback); // 写授权结果 // 获取广告账户列表 return $this->success(); } }