Skip to content

Commit b62f656

Browse files
committed
优化日志&刷新缓存
1 parent 68ec965 commit b62f656

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "addons package for fastadmin",
44
"homepage": "https://github.com/karsonzhang/fastadmin-addons",
55
"license": "Apache-2.0",
6-
"version": "1.3.1",
6+
"version": "1.3.2",
77
"authors": [
88
{
99
"name": "Karson",

src/addons/Service.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ public static function download($name, $extend = [])
8484
$body = $response->getBody();
8585
$content = $body->getContents();
8686
} else {
87-
Log::write("[addon]" . $content);
8887
//下载返回错误,抛出异常
8988
throw new AddonException($json['msg'], $json['code'], $json['data']);
9089
}
9190
}
9291
} catch (TransferException $e) {
93-
Log::write("[addon]" . $e->getMessage());
9492
throw new Exception(config('app_debug') ? $e->getMessage() : "Addon package download failed");
9593
}
9694

@@ -387,7 +385,7 @@ public static function refresh()
387385
$bootstrapArr = [];
388386
foreach ($addons as $name => $addon) {
389387
$bootstrapFile = self::getBootstrapFile($name);
390-
if ($addon['state'] && is_file($bootstrapFile) && self::isAuthorization($name)) {
388+
if ($addon['state'] && is_file($bootstrapFile)) {
391389
$bootstrapArr[] = file_get_contents($bootstrapFile);
392390
}
393391
}
@@ -1123,10 +1121,8 @@ public static function sendRequest($url, $params = [], $method = 'POST')
11231121
$content = $body->getContents();
11241122
$json = (array)json_decode($content, true);
11251123
} catch (TransferException $e) {
1126-
Log::write("[addon]" . $e->getMessage());
11271124
throw new Exception(config('app_debug') ? $e->getMessage() : __('Network error'));
11281125
} catch (\Exception $e) {
1129-
Log::write("[addon]" . $e->getMessage());
11301126
throw new Exception(config('app_debug') ? $e->getMessage() : __('Unknown data format'));
11311127
}
11321128
return $json;

0 commit comments

Comments
 (0)