From aeae0f3de571d620c2ceb822d0c0c94230c8a692 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 14 Feb 2019 12:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=AE=A1=E7=90=86=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/commontopmaxpicture/config.json | 32 ++++++++++++------- .../plugins/commontopnotice/config.json | 32 ++++++++++++------- .../plugins/usercentertopnotice/config.json | 32 ++++++++++++------- application/service/PluginsAdminService.php | 9 +++++- 4 files changed, 68 insertions(+), 37 deletions(-) diff --git a/application/plugins/commontopmaxpicture/config.json b/application/plugins/commontopmaxpicture/config.json index acf65eadc..28ed936e8 100755 --- a/application/plugins/commontopmaxpicture/config.json +++ b/application/plugins/commontopmaxpicture/config.json @@ -1,16 +1,24 @@ { - "base": { - "name": "顶部广告", - "logo": "/static/upload/images/plugins_commontopmaxpicture/2019/02/09/1549671733987654.png", - "author": "Devil", - "author_url": "https://shopxo.net/", - "version": "1.0.0", - "desc": "顶部大图广告,突破视觉", - "apply_terminal": ["pc"], - "apply_version": ["1.3.0"], - "is_home": false + "base":{ + "plugins":"commontopmaxpicture", + "name":"顶部广告", + "logo":"\/static\/upload\/images\/plugins_commontopmaxpicture\/2019\/02\/09\/1549671733987654.png", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"顶部大图广告,突破视觉", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.3.0" + ], + "is_home":false }, - "hook": { - "plugins_common_top": ["app\\plugins\\commontopmaxpicture\\Hook"] + "hook":{ + "plugins_common_top":[ + "app\\plugins\\commontopmaxpicture\\Hook" + ] } } \ No newline at end of file diff --git a/application/plugins/commontopnotice/config.json b/application/plugins/commontopnotice/config.json index 6ff00606e..e29936753 100755 --- a/application/plugins/commontopnotice/config.json +++ b/application/plugins/commontopnotice/config.json @@ -1,16 +1,24 @@ { - "base": { - "name": "顶部公告", - "logo": "/static/upload/images/plugins_commontopnotice/2019/02/12/1549671733987652.png", - "author": "Devil", - "author_url": "https://shopxo.net/", - "version": "1.0.0", - "desc": "顶部公告,通知", - "apply_terminal": ["pc"], - "apply_version": ["1.3.0"], - "is_home": false + "base":{ + "plugins":"commontopnotice", + "name":"顶部公告", + "logo":"\/static\/upload\/images\/plugins_commontopnotice\/2019\/02\/12\/1549671733987652.png", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"顶部公告,通知", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.3.0" + ], + "is_home":false }, - "hook": { - "plugins_common_top": ["app\\plugins\\commontopnotice\\Hook"] + "hook":{ + "plugins_common_top":[ + "app\\plugins\\commontopnotice\\Hook" + ] } } \ No newline at end of file diff --git a/application/plugins/usercentertopnotice/config.json b/application/plugins/usercentertopnotice/config.json index a11fb3b76..7d1d3a29c 100755 --- a/application/plugins/usercentertopnotice/config.json +++ b/application/plugins/usercentertopnotice/config.json @@ -1,16 +1,24 @@ { - "base": { - "name": "用户中心顶部公告", - "logo": "/static/upload/images/plugins_usercentertopnotice/2019/02/12/1549671733967341.png", - "author": "Devil", - "author_url": "https://shopxo.net/", - "version": "1.0.0", - "desc": "用户中心顶部公告,通知", - "apply_terminal": ["pc"], - "apply_version": ["1.3.0"], - "is_home": false + "base":{ + "plugins":"usercentertopnotice", + "name":"用户中心顶部公告", + "logo":"\/static\/upload\/images\/plugins_usercentertopnotice\/2019\/02\/12\/1549671733967341.png", + "author":"Devil", + "author_url":"https:\/\/shopxo.net\/", + "version":"1.0.0", + "desc":"用户中心顶部公告,通知", + "apply_terminal":[ + "pc", + "h5" + ], + "apply_version":[ + "1.3.0" + ], + "is_home":false }, - "hook": { - "plugins_user_center_top": ["app\\plugins\\usercentertopnotice\\Hook"] + "hook":{ + "plugins_user_center_top":[ + "app\\plugins\\usercentertopnotice\\Hook" + ] } } \ No newline at end of file diff --git a/application/service/PluginsAdminService.php b/application/service/PluginsAdminService.php index ed8cf484d..feac2c22b 100644 --- a/application/service/PluginsAdminService.php +++ b/application/service/PluginsAdminService.php @@ -753,8 +753,15 @@ php; 'hook' => (object) $hook, ]; + // 文件存在是否有权限 + $config_file = $app_dir.DS.'config.json'; + if(file_exists($config_file) && !is_writable($config_file)) + { + return DataReturn('应用配置文件没有操作权限'.'['.$config_file.']', -3); + } + // 创建配置文件 - if(@file_put_contents($app_dir.DS.'config.json', JsonFormat($data)) === false) + if(@file_put_contents($config_file, JsonFormat($data)) === false) { return DataReturn('应用配置文件创建失败', -10); } -- GitLab