fix: undefined variable $data error on auth failure

This commit is contained in:
Emil Zhai 2022-11-30 06:59:19 +00:00
parent e33a5cf0b4
commit b45bb0d7d5
No known key found for this signature in database
GPG Key ID: 780B385DB72F1EBD

View File

@ -64,13 +64,14 @@ class Access_Action extends Typecho_Widget implements Widget_Interface_Do
$this->checkAuth(); # 鉴权
if(!$this->request->isGet())
throw new Exception('Method Not Allowed', 405);
$rpcType = $this->request->get('rpc'); # 业务类型
$statistic = new Access_Statistic($this->request);
$data = $statistic->invoke($rpcType); # 进行业务分发并调取数据
$errCode = 0;
$errMsg = 'ok';
} catch (Exception $e) {
$data = null;
$errCode = $e->getCode();
$errMsg = $e->getMessage();
}