💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ <?php namespace app\common\controller; use think\Controller; use think\Session; //用户身份授权基类 class Authorized extends Controller { public function _initialize() { //判断(当前作用域)是否赋值 if (!Session::has('CURRENT_USER')) { $output['success'] = false; $output['msg'] = '未授权操作请求,请先登录'; _callback($output); } } } ~~~ 1. 针对登录用户的身份验证