no message

This commit is contained in:
kuaifan 2021-12-19 22:56:12 +08:00
parent 5181010d22
commit fa8c209ea3

View File

@ -237,8 +237,12 @@ class SystemController extends AbstractController
'list' => [], 'list' => [],
]; ];
// //
$file = base_path("electron/package.json"); $files = [
base_path("package.json"),
base_path("electron/package.json")
];
$dist = base_path("electron/dist"); $dist = base_path("electron/dist");
foreach ($files as $file) {
if (file_exists($file)) { if (file_exists($file)) {
$packageArray = json_decode(file_get_contents($file), true); $packageArray = json_decode(file_get_contents($file), true);
$array['name'] = $packageArray['name'] ?? 'No app'; $array['name'] = $packageArray['name'] ?? 'No app';
@ -269,6 +273,10 @@ class SystemController extends AbstractController
} }
} }
} }
if (count($array['list']) > 0) {
break;
}
}
// //
if (count($array['list']) == 0) { if (count($array['list']) == 0) {
return Base::retError('No file'); return Base::retError('No file');