应用优化
parent
589b5f9e19
commit
08bb69c3b4
|
|
@ -44,10 +44,10 @@ class Admin extends Common
|
|||
public function Index()
|
||||
{
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 参数
|
||||
$params = input();
|
||||
|
|
@ -104,7 +104,7 @@ class Admin extends Common
|
|||
public function SaveInfo()
|
||||
{
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 参数
|
||||
$params = input();
|
||||
|
|
@ -113,7 +113,7 @@ class Admin extends Common
|
|||
if(!isset($params['id']) || $params['id'] != $this->admin['id'])
|
||||
{
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
// 管理员编辑
|
||||
|
|
@ -154,7 +154,7 @@ class Admin extends Common
|
|||
public function Save()
|
||||
{
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 是否ajax
|
||||
if(!IS_AJAX)
|
||||
|
|
@ -178,10 +178,10 @@ class Admin extends Common
|
|||
public function Delete()
|
||||
{
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 是否ajax
|
||||
if(!IS_AJAX)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Answer extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class AppConfig extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class AppHomeNav extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class AppMiniAlipayConfig extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ class AppMiniAlipayList extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 参数
|
||||
$this->params = input();
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class AppMiniWeixinConfig extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ class AppMiniWeixinList extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 参数
|
||||
$this->params = input();
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Article extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class ArticleCategory extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Brand extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class BrandCategory extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ class Cache extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -79,13 +79,13 @@ class Common extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* [Is_Login 登录校验]
|
||||
* [IsLogin 登录校验]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-03T12:42:35+0800
|
||||
*/
|
||||
protected function Is_Login()
|
||||
protected function IsLogin()
|
||||
{
|
||||
if(session('admin') === null)
|
||||
{
|
||||
|
|
@ -138,16 +138,19 @@ class Common extends Controller
|
|||
|
||||
// 图片host地址
|
||||
$this->assign('attachment_host', config('shopxo.attachment_host'));
|
||||
|
||||
// 开发模式
|
||||
$this->assign('shopxo_is_develop', config('shopxo.is_develop'));
|
||||
}
|
||||
|
||||
/**
|
||||
* [Is_Power 是否有权限]
|
||||
* [IsPower 是否有权限]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-20T19:18:29+0800
|
||||
*/
|
||||
protected function Is_Power()
|
||||
protected function IsPower()
|
||||
{
|
||||
// 不需要校验权限的方法
|
||||
$unwanted_power = array('getnodeson');
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Config extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class CustomView extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Email extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Express extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ class Goods extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class GoodsCategory extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class Index extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class IntegralLog extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Link extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Message extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ class Navigation extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 导航类型
|
||||
$this->nav_type = input('nav_type', 'header');
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ class Order extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class PayLog extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Payment extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,13 @@ class Plugins extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 小导航
|
||||
$this->view_type = input('view_type', 'home');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,39 +52,48 @@ class Plugins extends Common
|
|||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 导航参数
|
||||
$this->assign('view_type', $this->view_type);
|
||||
|
||||
// 参数
|
||||
$params = input();
|
||||
|
||||
// 分页
|
||||
$number = 12;
|
||||
// 页面类型
|
||||
if($this->view_type == 'home')
|
||||
{
|
||||
// 分页
|
||||
$number = 12;
|
||||
|
||||
// 条件
|
||||
$where = PluginsService::PluginsListWhere($params);
|
||||
// 条件
|
||||
$where = PluginsService::PluginsListWhere($params);
|
||||
|
||||
// 获取总数
|
||||
$total = PluginsService::PluginsTotal($where);
|
||||
// 获取总数
|
||||
$total = PluginsService::PluginsTotal($where);
|
||||
|
||||
// 分页
|
||||
$page_params = array(
|
||||
'number' => $number,
|
||||
'total' => $total,
|
||||
'where' => $params,
|
||||
'page' => isset($params['page']) ? intval($params['page']) : 1,
|
||||
'url' => MyUrl('admin/plugins/index'),
|
||||
// 分页
|
||||
$page_params = array(
|
||||
'number' => $number,
|
||||
'total' => $total,
|
||||
'where' => $params,
|
||||
'page' => isset($params['page']) ? intval($params['page']) : 1,
|
||||
'url' => MyUrl('admin/plugins/index'),
|
||||
);
|
||||
$page = new \base\Page($page_params);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => $page->GetPageStarNumber(),
|
||||
'n' => $number,
|
||||
'where' => $where,
|
||||
);
|
||||
$page = new \base\Page($page_params);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$data = PluginsService::PluginsList($data_params);
|
||||
$this->assign('data_list', $data['data']);
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => $page->GetPageStarNumber(),
|
||||
'n' => $number,
|
||||
'where' => $where,
|
||||
);
|
||||
$data = PluginsService::PluginsList($data_params);
|
||||
$this->assign('data_list', $data['data']);
|
||||
|
||||
return $this->fetch();
|
||||
return $this->fetch();
|
||||
} else {
|
||||
return $this->fetch('upload');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Power extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Region extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class ScreeningPrice extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Seo extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Site extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Slide extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class Sms extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ class Theme extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
|
||||
// 小导航
|
||||
$this->view_type = input('view_type', 'home');
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class Ueditor extends Common
|
|||
if($this->current_action != 'config')
|
||||
{
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
}
|
||||
|
||||
// action
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ class User extends Common
|
|||
parent::__construct();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
$this->IsLogin();
|
||||
|
||||
// 权限校验
|
||||
$this->Is_Power();
|
||||
$this->IsPower();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,10 +3,16 @@
|
|||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- nav start -->
|
||||
{{include file="plugins/nav" /}}
|
||||
<!-- nav end -->
|
||||
|
||||
<!-- operation start -->
|
||||
<div class="am-g m-b-10">
|
||||
<a href="{{:MyUrl('admin/plugins/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
</div>
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
|
||||
<div class="am-g m-b-10 m-t-10">
|
||||
<a href="{{:MyUrl('admin/plugins/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
<!-- operation end -->
|
||||
|
||||
{{if !empty($data_list)}}
|
||||
|
|
@ -23,9 +29,11 @@
|
|||
</div>
|
||||
<div class="am-gallery-desc">{{$v.desc}}</div>
|
||||
<div class="operation">
|
||||
<a href="{{:MyUrl('admin/plugins/saveinfo', array('id'=>$v['id']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" title="编辑"></a>
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
|
||||
<a href="{{:MyUrl('admin/plugins/saveinfo', array('id'=>$v['id']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" title="编辑"></a>
|
||||
{{/if}}
|
||||
|
||||
<a href="{{:MyUrl('plugins/index/index', ['control'=>$v['plugins'], 'action'=>'index'])}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear" title="设置"></a>
|
||||
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>$v['plugins'], 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear" title="设置"></a>
|
||||
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/plugins/uninstall')}}" data-id="10" data-view="reload" data-msg="删除后不可恢复、确认操作吗?" title="删除"></button>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<ul class="am-nav am-nav-pills table-nav">
|
||||
<li {{if $view_type eq 'home'}}class="am-active"{{/if}}>
|
||||
<a href="{{:MyUrl('admin/plugins/index', ['view_type'=>'home'])}}">应用管理</a>
|
||||
</li>
|
||||
<li {{if $view_type eq 'upload'}}class="am-active"{{/if}}>
|
||||
<a href="{{:MyUrl('admin/plugins/index', ['view_type'=>'upload'])}}">上传安装</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- nav start -->
|
||||
{{include file="plugins/nav" /}}
|
||||
<!-- nav end -->
|
||||
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save m-t-10" action="{{:MyUrl('admin/plugins/upload')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/plugins/index')}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_file', 51200000, true)}}" />
|
||||
<div class="am-form-group am-form-file">
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius">
|
||||
<i class="am-icon-cloud-upload"></i> 选择文件</button>
|
||||
<input type="file" name="plugins" class="file-event" data-tips-tag="#form-plugins-tips" multiple data-validation-message="请选择需要上传的文件" required />
|
||||
<span class="tips fs-12">上传一个zip压缩格式的主题安装包</span>
|
||||
<div id="form-plugins-tips"></div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm" data-am-loading="{loadingText:'上传中...'}">上传</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<!-- nav start -->
|
||||
{{include file="theme/nav" /}}
|
||||
<!-- nav end -->
|
||||
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save m-t-10" action="{{:MyUrl('admin/theme/upload')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/theme/index')}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_file', 51200000, true)}}" />
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use app\service\PluginsService;
|
|||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Commontopmaxpicture extends Controller
|
||||
class Index extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
|
|
@ -112,38 +112,6 @@ class Commontopmaxpicture extends Controller
|
|||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-06T16:16:34+0800
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
// 基础信息
|
||||
$base = [
|
||||
'name' => '顶部广告',
|
||||
'author' => 'Devil',
|
||||
'author_url' => 'https://shopxo.net/',
|
||||
'version' => '1.0.0',
|
||||
'desc' => '顶部大图广告,突破视觉',
|
||||
'apply_terminal'=> ['pc'],
|
||||
'apply_version' => ['1.3.0'],
|
||||
'sales_amount' => 0,
|
||||
];
|
||||
|
||||
// 钩子
|
||||
$hook = [
|
||||
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\Commontopmaxpicture'],
|
||||
];
|
||||
|
||||
return [
|
||||
'base' => $base,
|
||||
'hook' => $hook,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"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"],
|
||||
"sales_amount": 0
|
||||
},
|
||||
"hook": {
|
||||
"plugins_common_top": ["app\\plugins\\commontopmaxpicture\\Index"]
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ namespace app\plugins\controller;
|
|||
use think\Controller;
|
||||
|
||||
/**
|
||||
* 插件入口控制器
|
||||
* 应用入口控制器
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
|
|
@ -35,20 +35,53 @@ class Index extends Controller
|
|||
|
||||
// 参数
|
||||
$params = input();
|
||||
$control = strtolower($params['control']);
|
||||
$action = strtolower($params['action']);
|
||||
|
||||
// 请求参数校验
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'pluginsname',
|
||||
'error_msg' => '应用名称有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'pluginscontrol',
|
||||
'error_msg' => '应用控制器有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'pluginsaction',
|
||||
'error_msg' => '应用操作方法有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
{
|
||||
exit(json_encode(DataReturn($ret, -5000)));
|
||||
} else {
|
||||
$this->assign('msg', $ret);
|
||||
return $this->fetch('public/error');
|
||||
}
|
||||
}
|
||||
|
||||
// 应用名称/控制器/方法
|
||||
$pluginsname = $params['pluginsname'];
|
||||
$pluginscontrol = strtolower($params['pluginscontrol']);
|
||||
$pluginsaction = strtolower($params['pluginsaction']);
|
||||
|
||||
// 编辑器文件存放地址定义
|
||||
$this->assign('editor_path_type', 'plugins_'.$control);
|
||||
$this->assign('editor_path_type', 'plugins_'.$pluginsname);
|
||||
|
||||
// 系统初始化
|
||||
$this->SystemInit();
|
||||
|
||||
// 视图初始化
|
||||
$this->ViewInit($control, $action);
|
||||
$this->ViewInit($pluginsname, $pluginscontrol, $pluginsaction);
|
||||
|
||||
// 调用插件
|
||||
return controller(ucfirst($control), $control)->$action(input('post.'));
|
||||
// 调用应用
|
||||
return controller(ucfirst($pluginscontrol), $pluginsname)->$pluginsaction($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -91,26 +124,28 @@ class Index extends Controller
|
|||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T22:46:29+0800
|
||||
* @param [string] $controller_name [控制器名称]
|
||||
* @param [string] $action_name [方法]
|
||||
* @param [string] $plugins_name [应用名称]
|
||||
* @param [string] $plugins_control [控制器名称]
|
||||
* @param [string] $plugins_action [方法]
|
||||
*/
|
||||
public function ViewInit($controller_name, $action_name)
|
||||
public function ViewInit($plugins_name, $plugins_control, $plugins_action)
|
||||
{
|
||||
// 当前操作名称
|
||||
$module_name = strtolower(request()->module());
|
||||
|
||||
// 当前操作名称
|
||||
$this->assign('plugins_name', $plugins_name);
|
||||
$this->assign('module_name', $module_name);
|
||||
$this->assign('controller_name', $controller_name);
|
||||
$this->assign('action_name', $action_name);
|
||||
$this->assign('controller_name', $plugins_control);
|
||||
$this->assign('action_name', $plugins_action);
|
||||
|
||||
// 控制器静态文件状态css,js
|
||||
$module_css = $module_name.DS.'css'.DS.$controller_name;
|
||||
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$action_name.'.css') ? '.'.$action_name.'.css' : '.css';
|
||||
$module_css = $module_name.DS.'css'.DS.$plugins_name.DS.$plugins_control;
|
||||
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$plugins_action.'.css') ? '.'.$plugins_action.'.css' : '.css';
|
||||
$this->assign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
|
||||
|
||||
$module_js = $module_name.DS.'js'.DS.$controller_name;
|
||||
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$action_name.'.js') ? '.'.$action_name.'.js' : '.js';
|
||||
$module_js = $module_name.DS.'js'.DS.$plugins_name.DS.$plugins_control;
|
||||
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$plugins_action.'.js') ? '.'.$plugins_action.'.js' : '.js';
|
||||
$this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
|
||||
|
||||
// 图片host地址
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'saveinfo'])}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'saveinfo'])}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'save'])}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'index'])}}" enctype="multipart/form-data">
|
||||
<form class="am-form form-validation view-save" action="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'save'])}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
|
||||
<legend>
|
||||
<span class="fs-16">顶部大图</span>
|
||||
<a href="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'index'])}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group am-form-file">
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@
|
|||
{{/if}}
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
var __attachment_host__ = '{{$attachment_host}}';
|
||||
var __attachment_host__ = '{{if isset($attachment_host)}}{{$attachment_host}}{{/if}}';
|
||||
</script>
|
||||
<body>
|
||||
|
|
@ -67,9 +67,9 @@ class PluginsService
|
|||
$result[] = [
|
||||
'id' => $v['id'],
|
||||
'plugins' => $v['plugins'],
|
||||
'logo_old' => $v['logo'],
|
||||
'logo' => ResourcesService::AttachmentPathViewHandle($v['logo']),
|
||||
'is_enable' => $v['is_enable'],
|
||||
'logo_old' => $base['logo'],
|
||||
'logo' => ResourcesService::AttachmentPathViewHandle($base['logo']),
|
||||
'name' => isset($base['name']) ? $base['name'] : '',
|
||||
'author' => isset($base['author']) ? $base['author'] : '',
|
||||
'author_url' => isset($base['author_url']) ? $base['author_url'] : '',
|
||||
|
|
@ -261,14 +261,10 @@ class PluginsService
|
|||
*/
|
||||
private static function GetPluginsConfig($plugins)
|
||||
{
|
||||
$plugins = '\app\plugins\\'.$plugins.'\\'.ucfirst($plugins);
|
||||
if(class_exists($plugins))
|
||||
$config_file = APP_PATH.'plugins'.DS.$plugins.DS.'config.json';
|
||||
if(file_exists($config_file))
|
||||
{
|
||||
$obj = new $plugins();
|
||||
if(method_exists($obj, 'config'))
|
||||
{
|
||||
return $obj->config();
|
||||
}
|
||||
return json_decode(file_get_contents($config_file), true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@ return [
|
|||
'app_end' => [],
|
||||
|
||||
// 钩子测试
|
||||
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\Commontopmaxpicture'],
|
||||
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\Index'],
|
||||
];
|
||||
?>
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
return [
|
||||
// 开发模式
|
||||
'is_develop' => false,
|
||||
'is_develop' => true,
|
||||
|
||||
// 默认编码
|
||||
'default_charset' => 'utf-8',
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
/**
|
||||
* 列表
|
||||
*/
|
||||
.content ul {
|
||||
padding: 0px;
|
||||
width: calc(100% + 10px);
|
||||
|
|
@ -92,4 +95,11 @@
|
|||
.content ul li .base p {
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 安装
|
||||
*/
|
||||
input[name="plugins"] { width: 105px !important; height: 32px; }
|
||||
input.file-event { margin-top: 0 !important; }
|
||||
Loading…
Reference in New Issue