小程序插件配置空配置数组格式错误修复

feat/task1-c-wallet
Devil 2021-03-17 12:16:54 +08:00
parent 5a28886d68
commit a79c687195
1 changed files with 8 additions and 0 deletions

View File

@ -570,6 +570,14 @@ class AppMiniService
// 配置信息
$file = $new_dir.DS.'app.json';
$config = json_decode(file_get_contents($file), true);
// 插件配置为空防止成为数组
if(array_key_exists('plugins', $config) && empty($config['plugins']))
{
$config['plugins'] = (object) [];
}
// 历史信息
if(empty($config['history']))
{
$config['history'] = [];