diff --git a/application/admin/controller/Plugins.php b/application/admin/controller/Plugins.php index 64d4753bb..1b9b32ae1 100755 --- a/application/admin/controller/Plugins.php +++ b/application/admin/controller/Plugins.php @@ -10,6 +10,8 @@ // +---------------------------------------------------------------------- namespace app\admin\controller; +use app\service\PluginsService; + /** * 应用调用入口 * @author Devil @@ -76,7 +78,7 @@ class Plugins extends Common return DataReturn($ret, -5000); } else { $this->assign('msg', $ret); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } @@ -85,6 +87,19 @@ class Plugins extends Common $pluginscontrol = strtolower($params['pluginscontrol']); $pluginsaction = strtolower($params['pluginsaction']); + // 应用校验 + $ret = $this->PluginsCheck($pluginsname, $pluginscontrol, $pluginsaction); + if($ret['code'] != 0) + { + if(IS_AJAX) + { + return $ret; + } else { + $this->assign('msg', $ret['msg']); + return $this->fetch('public/tips_error'); + } + } + // 视图初始化 $this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction); @@ -96,7 +111,7 @@ class Plugins extends Common if(!class_exists($plugins)) { $this->assign('msg', ucfirst($pluginscontrol).' 应用控制器未定义'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } // 调用方法 @@ -104,11 +119,35 @@ class Plugins extends Common if(!method_exists($obj, $pluginsaction)) { $this->assign('msg', ucfirst($pluginsaction).' 应用方法未定义'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } return $obj->$pluginsaction($params); } + /** + * 应用校验 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-05-27T00:13:50+0800 + * @param [string] $plugins_name [应用名称] + * @param [string] $plugins_control [控制器名称] + * @param [string] $plugins_action [方法] + */ + private function PluginsCheck($pluginsname, $pluginscontrol, $pluginsaction) + { + $ret = PluginsService::PluginsData($pluginsname); + if($ret['code'] == 0) + { + $is_enable = PluginsService::PluginsField($pluginsname, 'is_enable'); + if($is_enable['data'] != 1) + { + return DataReturn('应用异常或未启用', -10); + } + } + return $ret; + } + /** * 视图初始化 * @author Devil diff --git a/application/admin/controller/Pluginsadmin.php b/application/admin/controller/Pluginsadmin.php index 1a973c1f9..7bf0e575f 100755 --- a/application/admin/controller/Pluginsadmin.php +++ b/application/admin/controller/Pluginsadmin.php @@ -243,7 +243,7 @@ class Pluginsadmin extends Common if(isset($ret['code']) && $ret['code'] != 0) { $this->assign('msg', $ret['msg']); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } else { return $ret; } diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index aeff71fd3..296193bb5 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -317,7 +317,7 @@ class Common extends Controller exit(json_encode(DataReturn($name.' 非法访问', -1000))); } else { $this->assign('msg', $name.' 非法访问'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } diff --git a/application/index/controller/Error.php b/application/index/controller/Error.php index ea2b3b239..974553512 100755 --- a/application/index/controller/Error.php +++ b/application/index/controller/Error.php @@ -38,7 +38,7 @@ class Error extends Common exit(json_encode(DataReturn($request->controller().' 控制器不存在', -1000))); } else { $this->assign('msg', $request->controller().' 控制器不存在'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } } diff --git a/application/index/controller/Order.php b/application/index/controller/Order.php index 49c95213c..e14f5b766 100755 --- a/application/index/controller/Order.php +++ b/application/index/controller/Order.php @@ -244,10 +244,10 @@ class Order extends Common if($ret['code'] == 0) { $this->assign('msg', '支付成功'); - return $this->fetch('public/pay_success'); + return $this->fetch('public/tips_success'); } else { $this->assign('msg', $ret['msg']); - return $this->fetch('public/pay_error'); + return $this->fetch('public/tips_error'); } } diff --git a/application/index/controller/Plugins.php b/application/index/controller/Plugins.php index 7979cffdb..c6f20cad9 100755 --- a/application/index/controller/Plugins.php +++ b/application/index/controller/Plugins.php @@ -10,6 +10,8 @@ // +---------------------------------------------------------------------- namespace app\index\controller; +use app\service\PluginsService; + /** * 应用调用入口 * @author Devil @@ -70,7 +72,7 @@ class Plugins extends Common return DataReturn($ret, -5000); } else { $this->assign('msg', $ret); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } @@ -79,6 +81,19 @@ class Plugins extends Common $pluginscontrol = strtolower($params['pluginscontrol']); $pluginsaction = strtolower($params['pluginsaction']); + // 应用校验 + $ret = $this->PluginsCheck($pluginsname, $pluginscontrol, $pluginsaction); + if($ret['code'] != 0) + { + if(IS_AJAX) + { + return $ret; + } else { + $this->assign('msg', $ret['msg']); + return $this->fetch('public/tips_error'); + } + } + // 视图初始化 $this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction); @@ -90,7 +105,7 @@ class Plugins extends Common if(!class_exists($plugins)) { $this->assign('msg', ucfirst($pluginscontrol).' 应用控制器未定义'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } // 调用方法 @@ -98,11 +113,35 @@ class Plugins extends Common if(!method_exists($obj, $pluginsaction)) { $this->assign('msg', ucfirst($pluginsaction).' 应用方法未定义'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } return $obj->$pluginsaction($params); } + /** + * 应用校验 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-05-27T00:13:50+0800 + * @param [string] $plugins_name [应用名称] + * @param [string] $plugins_control [控制器名称] + * @param [string] $plugins_action [方法] + */ + private function PluginsCheck($pluginsname, $pluginscontrol, $pluginsaction) + { + $ret = PluginsService::PluginsData($pluginsname); + if($ret['code'] == 0) + { + $is_enable = PluginsService::PluginsField($pluginsname, 'is_enable'); + if($is_enable['data'] != 1) + { + return DataReturn('应用异常或未启用', -10); + } + } + return $ret; + } + /** * 视图初始化 * @author Devil diff --git a/application/index/view/default/public/error.html b/application/index/view/default/public/error.html deleted file mode 100755 index 1b914021c..000000000 --- a/application/index/view/default/public/error.html +++ /dev/null @@ -1,31 +0,0 @@ -{{include file="public/header" /}} - - -{{if isset($is_header) and $is_header eq 1}} - - {{include file="public/header_top_nav" /}} - - - {{include file="public/nav_search" /}} - - - {{include file="public/header_nav" /}} - - - {{include file="public/goods_category" /}} -{{/if}} - - - -
-
-
-
{{$msg}}
-
-
-
- - - -{{include file="public/footer" /}} - \ No newline at end of file diff --git a/application/index/view/default/public/pay_error.html b/application/index/view/default/public/pay_error.html deleted file mode 100755 index 9867f99a5..000000000 --- a/application/index/view/default/public/pay_error.html +++ /dev/null @@ -1,38 +0,0 @@ -{{include file="public/header" /}} - - -{{if isset($is_header) and $is_header eq 1}} - - {{include file="public/header_top_nav" /}} - - - {{include file="public/nav_search" /}} - - - {{include file="public/header_nav" /}} - - - {{include file="public/goods_category" /}} -{{/if}} - - - -
-
-
-
- - {{$msg}} -
- 回到首页 - {{if !empty($to_url) and !empty($to_title)}} - {{$to_title}} - {{/if}} -
-
-
-
-
- - -{{include file="public/footer" /}} \ No newline at end of file diff --git a/application/index/view/default/public/pay_success.html b/application/index/view/default/public/pay_success.html deleted file mode 100755 index 9a6b8b2c0..000000000 --- a/application/index/view/default/public/pay_success.html +++ /dev/null @@ -1,38 +0,0 @@ -{{include file="public/header" /}} - - -{{if isset($is_header) and $is_header eq 1}} - - {{include file="public/header_top_nav" /}} - - - {{include file="public/nav_search" /}} - - - {{include file="public/header_nav" /}} - - - {{include file="public/goods_category" /}} -{{/if}} - - - -
-
-
-
- - {{$msg}} -
- 回到首页 - {{if !empty($to_url) and !empty($to_title)}} - {{$to_title}} - {{/if}} -
-
-
-
-
- - -{{include file="public/footer" /}} \ No newline at end of file diff --git a/application/index/view/default/public/tips_error.html b/application/index/view/default/public/tips_error.html index bb95bfc3c..1ab67c623 100755 --- a/application/index/view/default/public/tips_error.html +++ b/application/index/view/default/public/tips_error.html @@ -17,12 +17,19 @@ -
-
-
-
{{$msg}}
-
-
+
+
+
+ + {{$msg}} +
+ 回到首页 + {{if !empty($to_url) and !empty($to_title)}} + {{$to_title}} + {{/if}} +
+
+
diff --git a/application/index/view/default/public/tips_success.html b/application/index/view/default/public/tips_success.html new file mode 100755 index 000000000..70471f197 --- /dev/null +++ b/application/index/view/default/public/tips_success.html @@ -0,0 +1,36 @@ +{{include file="public/header" /}} + + +{{if isset($is_header) and $is_header eq 1}} + + {{include file="public/header_top_nav" /}} + + + {{include file="public/nav_search" /}} + + + {{include file="public/header_nav" /}} + + + {{include file="public/goods_category" /}} +{{/if}} + + + +
+
+
+ + {{$msg}} +
+ 回到首页 + {{if !empty($to_url) and !empty($to_title)}} + {{$to_title}} + {{/if}} +
+
+
+
+ + +{{include file="public/footer" /}} \ No newline at end of file diff --git a/application/install/controller/Common.php b/application/install/controller/Common.php index 9973112d0..0d81797be 100755 --- a/application/install/controller/Common.php +++ b/application/install/controller/Common.php @@ -52,7 +52,7 @@ class Common extends Controller public function _empty($name) { $this->assign('msg', $name.' 非法访问'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } ?> \ No newline at end of file diff --git a/application/install/controller/Error.php b/application/install/controller/Error.php index 98dd2efcc..3df22f3fd 100755 --- a/application/install/controller/Error.php +++ b/application/install/controller/Error.php @@ -34,7 +34,7 @@ class Error extends Common public function Index(Request $request) { $this->assign('msg', $request->controller().' 控制器不存在'); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } ?> \ No newline at end of file diff --git a/application/plugins/touristbuy/index/Index.php b/application/plugins/touristbuy/index/Index.php index ed7eb6a34..7bb4521dd 100755 --- a/application/plugins/touristbuy/index/Index.php +++ b/application/plugins/touristbuy/index/Index.php @@ -130,7 +130,7 @@ class Index extends Controller return $this->fetch('../../../plugins/view/touristbuy/index/index/success'); } else { $this->assign('msg', $ret['msg']); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } } diff --git a/application/plugins/view/weixinwebauthorization/admin/admin/index.html b/application/plugins/view/weixinwebauthorization/admin/admin/index.html index 78ff5651e..3834aad5a 100755 --- a/application/plugins/view/weixinwebauthorization/admin/admin/index.html +++ b/application/plugins/view/weixinwebauthorization/admin/admin/index.html @@ -4,7 +4,7 @@
- 微信登录 + 微信网页授权 返回 diff --git a/application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html b/application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html index a7a26c6c9..de9f0054f 100755 --- a/application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html +++ b/application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html @@ -6,7 +6,7 @@
- 微信登录 + 微信网页授权 返回 diff --git a/application/plugins/wallet/index/Recharge.php b/application/plugins/wallet/index/Recharge.php index cb2e10796..aa7ea4ca9 100755 --- a/application/plugins/wallet/index/Recharge.php +++ b/application/plugins/wallet/index/Recharge.php @@ -177,10 +177,10 @@ class Recharge extends Common if($ret['code'] == 0) { $this->assign('msg', '支付成功'); - return $this->fetch('public/pay_success'); + return $this->fetch('public/tips_success'); } else { $this->assign('msg', $ret['msg']); - return $this->fetch('public/pay_error'); + return $this->fetch('public/tips_error'); } } diff --git a/application/plugins/weixinwebauthorization/index/Auth.php b/application/plugins/weixinwebauthorization/index/Auth.php index 6568b25d1..ec76f7469 100644 --- a/application/plugins/weixinwebauthorization/index/Auth.php +++ b/application/plugins/weixinwebauthorization/index/Auth.php @@ -53,10 +53,10 @@ class Auth extends Controller if(isset($params['status']) && $params['status'] == 0) { $this->assign('msg', '支付成功'); - return $this->fetch('public/pay_success'); + return $this->fetch('public/tips_success'); } else { $this->assign('msg', '支付失败'); - return $this->fetch('public/pay_error'); + return $this->fetch('public/tips_error'); } } @@ -167,7 +167,7 @@ class Auth extends Controller return $this->fetch('../../../plugins/view/weixinwebauthorization/index/public/success'); } else { $this->assign('msg', $ret['msg']); - return $this->fetch('public/error'); + return $this->fetch('public/tips_error'); } } diff --git a/application/service/PluginsService.php b/application/service/PluginsService.php index d99691b9e..e1951d241 100755 --- a/application/service/PluginsService.php +++ b/application/service/PluginsService.php @@ -66,7 +66,12 @@ class PluginsService cache($key, $data); } } - return DataReturn('处理成功', 0, empty($data) ? [] : $data); + + if(empty($data)) + { + return DataReturn('应用不存在[ '.$plugins.' ]', -100, []); + } + return DataReturn('处理成功', 0, $data); } /** @@ -124,5 +129,21 @@ class PluginsService } return DataReturn('操作失败', -100); } + + /** + * 根据应用标记获取指定字段数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-29 + * @desc description + * @param [string] $plugins [应用标记] + * @param [string] $field [字段名称] + */ + public static function PluginsField($plugins, $field) + { + $data = Db::name('Plugins')->where(['plugins'=>$plugins])->value($field); + return DataReturn('操作成功', 0, $data); + } } ?> \ No newline at end of file diff --git a/public/static/index/default/css/common.css b/public/static/index/default/css/common.css index 40be75567..95f674fb9 100755 --- a/public/static/index/default/css/common.css +++ b/public/static/index/default/css/common.css @@ -256,9 +256,8 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a .price strong {color: #E4393C; font-weight: 600; } /* 公共错误提示页面 */ -.tips-error, .tips-success { margin: 10% 0; } -.tips-pay-success, .tips-pay-error, .tips-error, .tips-success { box-shadow: none; text-align: center; } -.tips-error i.am-icon-times-circle, .tips-success i.am-icon-check-circle { font-size: 26px; } +.tips-error, .tips-success { margin: 10% 0; background: #fff; } +.tips-error i.am-icon-times-circle, .tips-success i.am-icon-check-circle { font-size: 20px; } .tips-error i.am-icon-times-circle { color: #F44336; } .tips-success i.am-icon-check-circle { color: #4CAF50; } .tips-error span.msg, .tips-success span.msg { font-size: 22px; margin-left: 10px; }