提示页面优化
parent
74bd90c1a3
commit
98976ed514
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header nav start -->
|
||||
{{if isset($is_header) and $is_header eq 1}}
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
{{/if}}
|
||||
<!-- header nav end -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-g my-content">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-panel am-panel-danger am-radius tips-error">
|
||||
<div class="am-panel-bd">{{$msg}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header nav start -->
|
||||
{{if isset($is_header) and $is_header eq 1}}
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
{{/if}}
|
||||
<!-- header nav end -->
|
||||
|
||||
<!-- conntent start -->
|
||||
<div class="am-g my-content">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-panel am-radius tips-error tips-pay-error">
|
||||
<div class="am-panel-bd">
|
||||
<i class="am-icon-times-circle am-icon-lg"></i>
|
||||
<span class="msg">{{$msg}}</span>
|
||||
<div class="tips-nav">
|
||||
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-secondary am-radius">回到首页</a>
|
||||
{{if !empty($to_url) and !empty($to_title)}}
|
||||
<a href="{{$to_url}}" class="am-btn am-btn-primary am-radius">{{$to_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- conntent end -->
|
||||
|
||||
{{include file="public/footer" /}}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header nav start -->
|
||||
{{if isset($is_header) and $is_header eq 1}}
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
{{/if}}
|
||||
<!-- header nav end -->
|
||||
|
||||
<!-- conntent start -->
|
||||
<div class="am-g my-content">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-panel am-radius tips-success tips-pay-success">
|
||||
<div class="am-panel-bd">
|
||||
<i class="am-icon-check-circle am-icon-lg"></i>
|
||||
<span class="msg">{{$msg}}</span>
|
||||
<div class="tips-nav">
|
||||
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-secondary am-radius">回到首页</a>
|
||||
{{if !empty($to_url) and !empty($to_title)}}
|
||||
<a href="{{$to_url}}" class="am-btn am-btn-primary am-radius">{{$to_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- conntent end -->
|
||||
|
||||
{{include file="public/footer" /}}
|
||||
|
|
@ -17,10 +17,17 @@
|
|||
<!-- header nav end -->
|
||||
|
||||
<!-- conntent start -->
|
||||
<div class="am-g my-content">
|
||||
<div class="am-g my-content tips-error">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-panel am-panel-default am-radius tips-error">
|
||||
<div class="am-panel-bd">{{$msg}}</div>
|
||||
<div class="am-radius am-text-center">
|
||||
<i class="am-icon-times-circle am-icon-lg"></i>
|
||||
<span class="msg">{{$msg}}</span>
|
||||
<div class="tips-nav">
|
||||
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-secondary am-radius">回到首页</a>
|
||||
{{if !empty($to_url) and !empty($to_title)}}
|
||||
<a href="{{$to_url}}" class="am-btn am-btn-primary am-radius">{{$to_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- header nav start -->
|
||||
{{if isset($is_header) and $is_header eq 1}}
|
||||
<!-- header top nav -->
|
||||
{{include file="public/header_top_nav" /}}
|
||||
|
||||
<!-- search -->
|
||||
{{include file="public/nav_search" /}}
|
||||
|
||||
<!-- header nav -->
|
||||
{{include file="public/header_nav" /}}
|
||||
|
||||
<!-- goods category -->
|
||||
{{include file="public/goods_category" /}}
|
||||
{{/if}}
|
||||
<!-- header nav end -->
|
||||
|
||||
<!-- conntent start -->
|
||||
<div class="am-g my-content tips-success">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-radius am-text-center">
|
||||
<i class="am-icon-check-circle am-icon-lg"></i>
|
||||
<span class="msg">{{$msg}}</span>
|
||||
<div class="tips-nav">
|
||||
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-secondary am-radius">回到首页</a>
|
||||
{{if !empty($to_url) and !empty($to_title)}}
|
||||
<a href="{{$to_url}}" class="am-btn am-btn-primary am-radius">{{$to_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- conntent end -->
|
||||
|
||||
{{include file="public/footer" /}}
|
||||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">微信登录</span>
|
||||
<span class="fs-16">微信网页授权</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('weixinwebauthorization', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('weixinwebauthorization', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">微信登录</span>
|
||||
<span class="fs-16">微信网页授权</span>
|
||||
<a href="{{:PluginsAdminUrl('weixinwebauthorization', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue