Commit fad388ac authored by Euan游根明's avatar Euan游根明

perf: 注释

parent 9c49628b
......@@ -63,12 +63,12 @@ class Nacos
* @param $path
* @param $res
* @return void
* @throws Exception
* @throws \Exception
*/
public static function write($path,$res){
$save = file_put_contents($path, $res);
if ($save === false){
throw new Exception('保存配置失败'.$path);
throw new \Exception('保存配置失败'.$path);
}
}
......@@ -76,8 +76,8 @@ class Nacos
* 获取nacos配置
* @param $dataId
* @param $group
* @param $isSync
* @return false|\GuzzleHttp\Promise\PromiseInterface|mixed|string
* @return false|mixed|string
* @throws \Exception
*/
public static function getConfig($dataId, $group = 'DEFAULT_GROUP')
{
......@@ -97,9 +97,8 @@ class Nacos
* 发起请求
* @param $dataId
* @param $group
* @param $isSync
* @return \GuzzleHttp\Promise\PromiseInterface|mixed|string
* @throws \GuzzleHttp\Exception\GuzzleException
* @return mixed|string
* @throws \Exception
*/
public static function requery($dataId, $group)
{
......@@ -111,7 +110,6 @@ class Nacos
* 获取token
* @param $new
* @return mixed|string|null
* @throws \GuzzleHttp\Exception\GuzzleException
*/
private static function getToken($new = false)
{
......@@ -159,7 +157,7 @@ class Nacos
curl_close($curl);
$data = json_decode($response,true);
if (isset($data['status']) && $data['status'] == 403){
throw new Exception('token过期',403);
throw new \Exception('token过期',403);
}
if (isset($data['code']) && $data['code'] !== 0){
self::info('获取配置返回结果:'.$response);
......@@ -171,8 +169,9 @@ class Nacos
/**
* 登入
* @param $data
* @param $url
* @return mixed|string|void
* @throws \GuzzleHttp\Exception\GuzzleException
*/
private static function login($data,$url)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment