更新
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
// 应用公共文件
|
||||
use think\facade\Session;
|
||||
|
||||
define("SENTCMS_VERSION", '4.0.20200217');
|
||||
|
||||
@@ -14,9 +15,16 @@ define("SENTCMS_VERSION", '4.0.20200217');
|
||||
*
|
||||
*/
|
||||
function is_login() {
|
||||
return false;
|
||||
$user = Session::get('userInfo');
|
||||
return $user['uid'];
|
||||
}
|
||||
|
||||
function is_administrator() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function hook() {}
|
||||
|
||||
/**
|
||||
* 获取客户端IP地址
|
||||
* @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller;
|
||||
|
||||
use app\model\Menu;
|
||||
|
||||
/**
|
||||
* @title 后端公共模块
|
||||
*/
|
||||
@@ -32,7 +34,236 @@ class Admin extends Base {
|
||||
protected function initialize() {
|
||||
$url = str_replace(".", "/", strtolower($this->request->controller())) . '/' . $this->request->action();
|
||||
if (!is_login() and !in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
|
||||
$this->redirect('admin/index/login');
|
||||
$this->redirect('/admin/index/login');
|
||||
}
|
||||
|
||||
if (!in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
|
||||
|
||||
// 是否是超级管理员
|
||||
define('IS_ROOT', is_administrator());
|
||||
if (!IS_ROOT && \think\Config::get('admin_allow_ip')) {
|
||||
// 检查IP地址访问
|
||||
if (!in_array(get_client_ip(), explode(',', \think\Config::get('admin_allow_ip')))) {
|
||||
$this->error('403:禁止访问');
|
||||
}
|
||||
}
|
||||
|
||||
// 检测系统权限
|
||||
if (!IS_ROOT) {
|
||||
$access = $this->accessControl();
|
||||
if (false === $access) {
|
||||
$this->error('403:禁止访问');
|
||||
} elseif (null === $access) {
|
||||
$dynamic = $this->checkDynamic(); //检测分类栏目有关的各项动态权限
|
||||
if ($dynamic === null) {
|
||||
//检测访问权限
|
||||
if (!$this->checkRule($this->url_path, array('in', '1,2'))) {
|
||||
$this->error('未授权访问!');
|
||||
} else {
|
||||
// 检测分类及内容有关的各项动态权限
|
||||
$dynamic = $this->checkDynamic();
|
||||
if (false === $dynamic) {
|
||||
$this->error('未授权访问!');
|
||||
}
|
||||
}
|
||||
} elseif ($dynamic === false) {
|
||||
$this->error('未授权访问!');
|
||||
}
|
||||
}
|
||||
}
|
||||
//菜单设置
|
||||
$this->getMenu();
|
||||
// $this->setMeta();
|
||||
// $this->data['__menu__'] = ['main' => [], 'child' => []];
|
||||
$this->data['meta_title'] = $this->getCurrentTitle();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限检测
|
||||
* @param string $rule 检测的规则
|
||||
* @param string $mode check模式
|
||||
* @return boolean
|
||||
* @author 朱亚杰 <xcoolcc@gmail.com>
|
||||
*/
|
||||
final protected function checkRule($rule, $type = AuthRule::rule_url, $mode = 'url') {
|
||||
static $Auth = null;
|
||||
if (!$Auth) {
|
||||
$Auth = new \com\Auth();
|
||||
}
|
||||
if (!$Auth->check($rule, session('user_auth.uid'), $type, $mode)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否是需要动态判断的权限
|
||||
* @return boolean|null
|
||||
* 返回true则表示当前访问有权限
|
||||
* 返回false则表示当前访问无权限
|
||||
* 返回null,则表示权限不明
|
||||
*
|
||||
* @author 朱亚杰 <xcoolcc@gmail.com>
|
||||
*/
|
||||
protected function checkDynamic() {
|
||||
if (IS_ROOT) {
|
||||
return true; //管理员允许访问任何页面
|
||||
}
|
||||
return null; //不明,需checkRule
|
||||
}
|
||||
|
||||
/**
|
||||
* action访问控制,在 **登陆成功** 后执行的第一项权限检测任务
|
||||
*
|
||||
* @return boolean|null 返回值必须使用 `===` 进行判断
|
||||
*
|
||||
* 返回 **false**, 不允许任何人访问(超管除外)
|
||||
* 返回 **true**, 允许任何管理员访问,无需执行节点权限检测
|
||||
* 返回 **null**, 需要继续执行节点权限检测决定是否允许访问
|
||||
* @author 朱亚杰 <xcoolcc@gmail.com>
|
||||
*/
|
||||
final protected function accessControl() {
|
||||
$allow = \think\Config::get('allow_visit');
|
||||
$deny = \think\Config::get('deny_visit');
|
||||
$check = strtolower($this->request->controller() . '/' . $this->request->action());
|
||||
if (!empty($deny) && in_array_case($check, $deny)) {
|
||||
return false; //非超管禁止访问deny中的方法
|
||||
}
|
||||
if (!empty($allow) && in_array_case($check, $allow)) {
|
||||
return true;
|
||||
}
|
||||
return null; //需要检测节点权限
|
||||
}
|
||||
|
||||
protected function getMenu() {
|
||||
$hover_url = str_replace(".", "/", strtolower($this->request->controller()));
|
||||
$controller = str_replace(".", "/", strtolower($this->request->controller()));
|
||||
$menu = array(
|
||||
'main' => array(),
|
||||
'child' => array(),
|
||||
);
|
||||
$where['pid'] = 0;
|
||||
$where['hide'] = 0;
|
||||
$where['type'] = 'admin';
|
||||
if (!config('develop_mode')) {
|
||||
// 是否开发者模式
|
||||
$where['is_dev'] = 0;
|
||||
}
|
||||
$row = Menu::where($where)->order('sort asc')->field('id,title,url,icon,"" as style')->select();
|
||||
foreach ($row as $key => $value) {
|
||||
//此处用来做权限判断
|
||||
if (!IS_ROOT && !$this->checkRule($value['url'], 2, null)) {
|
||||
unset($menu['main'][$value['id']]);
|
||||
continue; //继续循环
|
||||
}
|
||||
if ($controller == $value['url']) {
|
||||
$value['style'] = "active";
|
||||
}
|
||||
$menu['main'][$value['id']] = $value;
|
||||
}
|
||||
|
||||
// 查找当前子菜单
|
||||
$pid = Menu::where("pid !=0 AND url like '%{$hover_url}%'")->value('pid');
|
||||
$id = Menu::where("pid = 0 AND url like '%{$hover_url}%'")->value('id');
|
||||
$pid = $pid ? $pid : $id;
|
||||
if (strtolower($hover_url) == 'admin/content' || strtolower($hover_url) == 'admin/attribute') {
|
||||
//内容管理菜单
|
||||
$pid = Menu::where("pid =0 AND url like '%admin/category%'")->value('id');
|
||||
}
|
||||
if ($pid) {
|
||||
$map['pid'] = $pid;
|
||||
$map['hide'] = 0;
|
||||
$map['type'] = 'admin';
|
||||
$row = Menu::field("id,title,url,icon,`group`,pid,'' as style")->where($map)->order('sort asc')->select();
|
||||
foreach ($row as $key => $value) {
|
||||
if (IS_ROOT || $this->checkRule($value['url'], 2, null)) {
|
||||
if ($controller == $value['url']) {
|
||||
$menu['main'][$value['pid']]['style'] = "active";
|
||||
$value['style'] = "active";
|
||||
}
|
||||
$menu['child'][$value['group']][] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->data['__menu__'] = $menu;
|
||||
}
|
||||
|
||||
protected function getContentMenu() {
|
||||
$model = \think\Loader::model('Model');
|
||||
$list = array();
|
||||
$map = array(
|
||||
'status' => array('gt', 0),
|
||||
);
|
||||
$list = $model::where($map)->field("name,id,title,icon,'' as 'style'")->select();
|
||||
|
||||
//判断是否有模型权限
|
||||
$models = AuthGroup::getAuthModels(session('user_auth.uid'));
|
||||
foreach ($list as $key => $value) {
|
||||
if (IS_ROOT || in_array($value['id'], $models)) {
|
||||
if ('admin/content/index' == $this->request->path() && input('model_id') == $value['id']) {
|
||||
$value['style'] = "active";
|
||||
}
|
||||
$value['url'] = "admin/content/index?model_id=" . $value['id'];
|
||||
$value['title'] = $value['title'] . "管理";
|
||||
$value['icon'] = $value['icon'] ? $value['icon'] : 'file';
|
||||
$menu[] = $value;
|
||||
}
|
||||
}
|
||||
if (!empty($menu)) {
|
||||
$this->assign('extend_menu', array('内容管理' => $menu));
|
||||
}
|
||||
}
|
||||
|
||||
protected function getAddonsMenu() {
|
||||
$model = db('Addons');
|
||||
$list = array();
|
||||
$map = array(
|
||||
'isinstall' => array('gt', 0),
|
||||
'status' => array('gt', 0),
|
||||
);
|
||||
$list = $model->field("name,id,title,'' as 'style'")->where($map)->select();
|
||||
|
||||
$menu = array();
|
||||
foreach ($list as $key => $value) {
|
||||
$class = "\\addons\\" . strtolower($value['name']) . "\\controller\\Admin";
|
||||
if (is_file(ROOT_PATH . '/addons/' . strtolower($value['name']) . "/controller/Admin.php")) {
|
||||
$action = get_class_methods($class);
|
||||
$value['url'] = "admin/addons/execute?mc=" . strtolower($value['name']) . "&ac=" . $action[0];
|
||||
$menu[$key] = $value;
|
||||
}
|
||||
}
|
||||
if (!empty($menu)) {
|
||||
$this->assign('extend_menu', array('管理插件' => $menu));
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCurrentTitle() {
|
||||
$mate = '';
|
||||
$controller = strtr(strtolower($this->request->controller()), '.', '\\');
|
||||
$action = $this->request->action();
|
||||
$class = "\\app\\controller\\" . $controller;
|
||||
if (class_exists($class)) {
|
||||
$reflection = new \ReflectionClass($class);
|
||||
$group_doc = $this->Parser($reflection->getDocComment());
|
||||
if(isset($group_doc['title'])){
|
||||
$mate = $group_doc['title'];
|
||||
}
|
||||
$method = $reflection->getMethods(\ReflectionMethod::IS_FINAL | \ReflectionMethod::IS_PUBLIC);
|
||||
foreach ($method as $key => $v) {
|
||||
if($action == $v->name){
|
||||
$title_doc = $this->Parser($v->getDocComment());
|
||||
if(isset($title_doc['title'])){
|
||||
$mate = $title_doc['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $mate;
|
||||
}
|
||||
|
||||
protected function Parser($text) {
|
||||
$doc = new \doc\Doc();
|
||||
return $doc->parse($text);
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 行为管理
|
||||
@@ -26,7 +26,7 @@ class Action extends Admin {
|
||||
$order = "id desc";
|
||||
//获取列表数据
|
||||
$list = model('Action')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 广告管理
|
||||
@@ -33,7 +33,7 @@ class Ad extends Admin {
|
||||
$order = "id desc";
|
||||
|
||||
$list = db('AdPlace')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
@@ -51,14 +51,14 @@ class Ad extends Admin {
|
||||
$place = model('AdPlace');
|
||||
if ($this->request->isPost()) {
|
||||
$result = $place->change();
|
||||
if (!empty($_POST['name'])){
|
||||
if (!empty($_POST['name'])) {
|
||||
$result = $place->change();
|
||||
if ($result) {
|
||||
return $this->success("添加成功!");
|
||||
} else {
|
||||
return $this->error($place->getError());
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return $this->error("标识不能为空!");
|
||||
}
|
||||
} else {
|
||||
@@ -124,7 +124,7 @@ class Ad extends Admin {
|
||||
$order = "id desc";
|
||||
|
||||
$list = db('Ad')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$data = array(
|
||||
'id' => $id,
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 插件管理
|
||||
@@ -33,7 +33,7 @@ class Addons extends Admin {
|
||||
$this->addons->refresh();
|
||||
}
|
||||
$list = $this->addons->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
@@ -222,7 +222,7 @@ class Addons extends Admin {
|
||||
$map = array();
|
||||
$order = "id desc";
|
||||
$list = model('Hooks')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
// 记录当前列表页的cookie
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 字段管理
|
||||
@@ -54,7 +54,7 @@ class Attribute extends Admin {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
$list = model('Attribute')->where('model_id', $model_id)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
@@ -96,7 +96,7 @@ class Attribute extends Admin {
|
||||
*/
|
||||
public function edit($id = '', $model_id = '') {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->validate('attribute.edit')->save($this->request->param(), array('id'=>$id));
|
||||
$result = $this->model->validate('attribute.edit')->save($this->request->param(), array('id' => $id));
|
||||
if ($result) {
|
||||
return $this->success("修改成功!", url('Attribute/index', array('model_id' => $model_id)));
|
||||
} else {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 频道管理
|
||||
@@ -41,7 +41,7 @@ class Channel extends Admin {
|
||||
|
||||
$data = array(
|
||||
'tree' => $list,
|
||||
'type' => $type
|
||||
'type' => $type,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('导航管理');
|
||||
@@ -151,7 +151,7 @@ class Channel extends Admin {
|
||||
if (db('Channel')->where($map)->delete()) {
|
||||
//删除category中的ismenu字段记录
|
||||
$map = array('ismenu' => array('in', $id));
|
||||
db('Category')->where($map)->setField('ismenu',0);
|
||||
db('Category')->where($map)->setField('ismenu', 0);
|
||||
//记录行为
|
||||
action_log('update_channel', 'channel', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功');
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 客户端管理
|
||||
@@ -23,13 +23,13 @@ class Client extends Admin {
|
||||
/**
|
||||
* @title 客户端列表
|
||||
*/
|
||||
public function index(){
|
||||
public function index() {
|
||||
$list = $this->model->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render()
|
||||
'page' => $list->render(),
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('客户端列表');
|
||||
@@ -39,20 +39,20 @@ class Client extends Admin {
|
||||
/**
|
||||
* @title 添加客户端
|
||||
*/
|
||||
public function add(\think\Request $request){
|
||||
public function add(\think\Request $request) {
|
||||
if ($this->request->isPost()) {
|
||||
$data = $request->param();
|
||||
$result = $this->model->validate(true)->save($data);
|
||||
if (false !== $result) {
|
||||
return $this->success('成功添加', url('client/index'));
|
||||
}else{
|
||||
} else {
|
||||
return $this->error($this->model->getError());
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$info['appid'] = rand_string(10, 1); //八位数字appid
|
||||
$info['appsecret'] = rand_string(32); //32位数字加字母秘钥
|
||||
$data = array(
|
||||
'info' => $info
|
||||
'info' => $info,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('添加客户端');
|
||||
@@ -63,19 +63,19 @@ class Client extends Admin {
|
||||
/**
|
||||
* @title 编辑客户端
|
||||
*/
|
||||
public function edit(\think\Request $request){
|
||||
public function edit(\think\Request $request) {
|
||||
if ($this->request->isPost()) {
|
||||
$data = $request->param();
|
||||
$result = $this->model->validate(true)->save($data, array('id'=>$request->param('id')));
|
||||
$result = $this->model->validate(true)->save($data, array('id' => $request->param('id')));
|
||||
if (false !== $result) {
|
||||
return $this->success('修改添加', url('client/index'));
|
||||
}else{
|
||||
} else {
|
||||
return $this->error($this->model->getError());
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$info = $this->model->where('id', $request->param('id'))->find();
|
||||
$data = array(
|
||||
'info' => $info
|
||||
'info' => $info,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('编辑客户端');
|
||||
@@ -86,7 +86,7 @@ class Client extends Admin {
|
||||
/**
|
||||
* @title 删除客户端
|
||||
*/
|
||||
public function del(\think\Request $request){
|
||||
public function del(\think\Request $request) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,9 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
use app\model\Config as ConfigM;
|
||||
|
||||
/**
|
||||
* @title 配置管理
|
||||
@@ -17,7 +18,7 @@ class Config extends Admin {
|
||||
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
$this->model = model('Config');
|
||||
$this->model = new ConfigM();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,7 +39,7 @@ class Config extends Admin {
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
// 记录当前列表页的cookie
|
||||
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
||||
@@ -71,12 +72,12 @@ class Config extends Admin {
|
||||
return $this->success("更新成功!");
|
||||
} else {
|
||||
$type = config('config_group_list');
|
||||
$list = db("Config")->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select();
|
||||
$list = (new ConfigM())->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select();
|
||||
if ($list) {
|
||||
$this->assign('list', $list);
|
||||
$this->data['list'] = $list;
|
||||
}
|
||||
$this->assign('id', $id);
|
||||
$this->setMeta($type[$id] . '设置');
|
||||
// $this->assign('id', $id);
|
||||
// $this->setMeta($type[$id] . '设置');
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -238,12 +239,12 @@ class Config extends Admin {
|
||||
* @title 设置主题
|
||||
* @return json
|
||||
*/
|
||||
public function setthemes($name, $id){
|
||||
public function setthemes($name, $id) {
|
||||
$result = db('Config')->where('name', $name . '_themes')->setField('value', $id);
|
||||
if (false !== $result) {
|
||||
\think\Cache::clear();
|
||||
return $this->success('设置成功!');
|
||||
}else{
|
||||
} else {
|
||||
return $this->error('设置失败!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 内容管理
|
||||
@@ -47,9 +46,8 @@ class Content extends Admin {
|
||||
$map = $this->buildMap();
|
||||
$field = array_filter($grid_list['fields']);
|
||||
|
||||
|
||||
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
@@ -106,7 +104,7 @@ class Content extends Admin {
|
||||
*/
|
||||
public function edit($id) {
|
||||
if ($this->request->isPost()) {
|
||||
$result = $this->model->save($this->request->param(), array('id'=> $id));
|
||||
$result = $this->model->save($this->request->param(), array('id' => $id));
|
||||
if ($result !== false) {
|
||||
//记录行为
|
||||
action_log('update_content', 'content', $result, session('auth_user.uid'));
|
||||
@@ -213,7 +211,7 @@ class Content extends Admin {
|
||||
foreach ($field_group as $key => $value) {
|
||||
$fields[$value] = isset($list[$key]) ? $list[$key] : array();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$fields = array();
|
||||
}
|
||||
return $fields;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 用户组管理
|
||||
@@ -32,7 +32,7 @@ class Group extends Admin {
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
@@ -93,7 +93,6 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 编辑用户组单字段
|
||||
*/
|
||||
@@ -109,7 +108,6 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 删除用户组
|
||||
*/
|
||||
@@ -126,7 +124,6 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 权限节点
|
||||
*/
|
||||
@@ -134,7 +131,7 @@ class Group extends Admin {
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(15, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\Member;
|
||||
use think\facade\Session;
|
||||
|
||||
/**
|
||||
* @title 后端公共模块
|
||||
@@ -39,20 +40,14 @@ class Index extends Admin {
|
||||
return $this->error('验证码错误!', '');
|
||||
}
|
||||
|
||||
try {
|
||||
$userinfo = $user->login($this->request);
|
||||
if ($userinfo) {
|
||||
// return $this->success('登录成功!', url('admin/index/index'));
|
||||
} else {
|
||||
print_r($user->error);
|
||||
// switch ($uid) {
|
||||
// case -1:$error = '用户不存在或被禁用!';
|
||||
// break; //系统级别禁用
|
||||
// case -2:$error = '密码错误!';
|
||||
// break;
|
||||
// default:$error = '未知错误!';
|
||||
// break; // 0-接口参数错误(调试阶段使用)
|
||||
// }
|
||||
return $this->error($error, '');
|
||||
Session::set('userInfo', $userinfo);
|
||||
return $this->success('登录成功!', url('/admin/index/index'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return $this->error($e->getError(), '');
|
||||
}
|
||||
} else {
|
||||
return $this->fetch();
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 友情链接
|
||||
@@ -24,7 +24,7 @@ class Link extends Admin {
|
||||
|
||||
$order = "id desc";
|
||||
$list = db('Link')->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
@@ -64,7 +64,6 @@ class Link extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 修改链接
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 菜单管理
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title 模型管理
|
||||
@@ -30,7 +30,7 @@ class Model extends Admin {
|
||||
|
||||
$order = "id desc";
|
||||
$list = $this->model->where($map)->order($order)->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
/**
|
||||
* @title SEO管理
|
||||
@@ -32,7 +32,7 @@ class Seo extends Admin {
|
||||
$map = array('status' => array('EGT', 0));
|
||||
|
||||
$list = $this->seo->where($map)->order('sort asc')->paginate(10, false, array(
|
||||
'query' => $this->request->param()
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$data = array(
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
use app\controller\Admin;
|
||||
|
||||
class Upload extends Admin {
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\controller;
|
||||
use app\common\controller\Admin;
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\controller\Admin;
|
||||
use app\model\Member;
|
||||
/**
|
||||
* @title 用户管理
|
||||
*/
|
||||
@@ -19,9 +20,9 @@ class User extends Admin {
|
||||
* @title 用户列表
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
public function index() {
|
||||
public function index(Member $member) {
|
||||
$param = $this->request->param();
|
||||
$map['status'] = array('egt', 0);
|
||||
$map[] = ['status', '>=', 0];
|
||||
if (isset($param['nickname']) && $param['nickname']) {
|
||||
$map['nickname'] = array('like', '%' . $param['nickname'] . '%');
|
||||
}
|
||||
@@ -30,18 +31,14 @@ class User extends Admin {
|
||||
}
|
||||
|
||||
$order = "uid desc";
|
||||
$list = model('Member')->where($map)->order($order)
|
||||
$list = $member->where($map)->order($order)
|
||||
->paginate(15, false, array(
|
||||
'param' => $param
|
||||
'param' => $param,
|
||||
));
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
'param' => $param
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('用户信息');
|
||||
$this->data['list'] = $list;
|
||||
$this->data['page'] = $list->render();
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
@@ -111,7 +108,6 @@ class User extends Admin {
|
||||
return $this->success('删除用户成功!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 用户授权
|
||||
* @author colin <colin@tensent.cn>
|
||||
|
||||
@@ -68,11 +68,11 @@ class Member extends Model {
|
||||
$map['mobile'] = $username;
|
||||
break;
|
||||
default:
|
||||
$this->error = "参数错误";
|
||||
throw new \think\Exception('参数错误', 10006);
|
||||
return false; //参数错误
|
||||
}
|
||||
if (!$username) {
|
||||
$this->error = "用户名不能为空";
|
||||
throw new \think\Exception('用户名不能为空', 10006);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ class Member extends Model {
|
||||
$this->record($user);
|
||||
return $user->append(array('access_token', 'avatar'))->visible($this->loginVisible)->toArray(); //登录成功,返回用户信息
|
||||
} else {
|
||||
$this->error = "密码错误";
|
||||
throw new \think\Exception('密码错误', 10006);
|
||||
return false; //密码错误
|
||||
}
|
||||
} else {
|
||||
$this->error = "用户不存在或被禁用";
|
||||
throw new \think\Exception('用户不存在或被禁用', 10006);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace app\model;
|
||||
* 菜单模型类
|
||||
* @author molong <molong@tensent.cn>
|
||||
*/
|
||||
class Menu extends \app\common\model\Base {
|
||||
class Menu extends \think\Model {
|
||||
|
||||
protected $type = array(
|
||||
'id' => 'integer',
|
||||
|
||||
2
extend/.gitignore
vendored
2
extend/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
135
extend/doc/Doc.php
Normal file
135
extend/doc/Doc.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace doc;
|
||||
|
||||
Class Doc{
|
||||
|
||||
private $params = array ();
|
||||
/**
|
||||
* 解析注释
|
||||
* @param string $doc
|
||||
* @return array
|
||||
*/
|
||||
public function parse($doc = '') {
|
||||
if ($doc == '' || !$doc) {
|
||||
return $this->params;
|
||||
}
|
||||
// Get the comment
|
||||
if (preg_match ( '#^/\*\*(.*)\*/#s', $doc, $comment ) === false)
|
||||
return $this->params;
|
||||
$comment = trim ( $comment [1] );
|
||||
// Get all the lines and strip the * from the first character
|
||||
if (preg_match_all ( '#^\s*\*(.*)#m', $comment, $lines ) === false)
|
||||
return $this->params;
|
||||
$this->parseLines ( $lines [1] );
|
||||
return $this->params;
|
||||
}
|
||||
|
||||
private function parseLines($lines) {
|
||||
$desc = [];
|
||||
foreach ( $lines as $line ) {
|
||||
$parsedLine = $this->parseLine ( $line ); // Parse the line
|
||||
if ($parsedLine === false && ! isset ( $this->params ['description'] )) {
|
||||
if (isset ( $desc )) {
|
||||
// Store the first line in the short description
|
||||
$this->params ['description'] = implode ( PHP_EOL, $desc );
|
||||
}
|
||||
$desc = array ();
|
||||
} elseif ($parsedLine !== false) {
|
||||
$desc [] = $parsedLine; // Store the line in the long description
|
||||
}
|
||||
}
|
||||
$desc = implode ( ' ', $desc );
|
||||
if (! empty ( $desc ))
|
||||
$this->params ['long_description'] = $desc;
|
||||
}
|
||||
|
||||
private function parseLine($line) {
|
||||
// trim the whitespace from the line
|
||||
$line = trim ( $line );
|
||||
if (empty ( $line ))
|
||||
return false; // Empty line
|
||||
if (strpos ( $line, '@' ) === 0) {
|
||||
if (strpos ( $line, ' ' ) > 0) {
|
||||
// Get the parameter name
|
||||
$param = substr ( $line, 1, strpos ( $line, ' ' ) - 1 );
|
||||
$value = substr ( $line, strlen ( $param ) + 2 ); // Get the value
|
||||
} else {
|
||||
$param = substr ( $line, 1 );
|
||||
$value = '';
|
||||
}
|
||||
// Parse the line and return false if the parameter is valid
|
||||
if ($this->setParam ( $param, $value ))
|
||||
return false;
|
||||
}
|
||||
return $line;
|
||||
}
|
||||
|
||||
private function setParam($param, $value) {
|
||||
if ($param == 'param' || $param == 'header')
|
||||
$value = $this->formatParam( $value );
|
||||
if ($param == 'class')
|
||||
list ( $param, $value ) = $this->formatClass ( $value );
|
||||
if($param == 'return' || $param == 'param' || $param == 'header'){
|
||||
$this->params [$param][] = $value;
|
||||
}else if (empty ( $this->params [$param] )) {
|
||||
$this->params [$param] = $value;
|
||||
} else {
|
||||
$this->params [$param] = $this->params [$param] . $value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function formatClass($value) {
|
||||
$r = preg_split ( "[\(|\)]", $value );
|
||||
if (is_array ( $r )) {
|
||||
$param = $r [0];
|
||||
parse_str ( $r [1], $value );
|
||||
foreach ( $value as $key => $val ) {
|
||||
$val = explode ( ',', $val );
|
||||
if (count ( $val ) > 1)
|
||||
$value [$key] = $val;
|
||||
}
|
||||
} else {
|
||||
$param = 'Unknown';
|
||||
}
|
||||
return array (
|
||||
$param,
|
||||
$value
|
||||
);
|
||||
}
|
||||
|
||||
private function formatParam($string) {
|
||||
$string = $string." ";
|
||||
if(preg_match_all('/(\w+):(.*?)[\s\n]/s', $string, $meatchs)){
|
||||
$param = [];
|
||||
foreach ($meatchs[1] as $key=>$value){
|
||||
$param[$meatchs[1][$key]] = $this->getParamType($meatchs[2][$key]);
|
||||
}
|
||||
return $param;
|
||||
}else{
|
||||
return ''.$string;
|
||||
}
|
||||
}
|
||||
private function getParamType($type){
|
||||
$typeMaps = [
|
||||
'string' => '字符串',
|
||||
'int' => '整型',
|
||||
'float' => '浮点型',
|
||||
'boolean' => '布尔型',
|
||||
'date' => '日期',
|
||||
'array' => '数组',
|
||||
'fixed' => '固定值',
|
||||
'enum' => '枚举类型',
|
||||
'object' => '对象',
|
||||
];
|
||||
return array_key_exists($type,$typeMaps) ? $typeMaps[$type] : $type;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 9.4 KiB |
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box no-header clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box no-header clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box no-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<!-- datepicker end -->
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/board/board.min.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="{:url('Index/index')}" id="logo" class="navbar-brand">
|
||||
<img src="__STATIC__/images/logo.png" alt="" class="normal-logo logo-white"/>
|
||||
<img src="__static__/common/images/logo.png" alt="" class="normal-logo logo-white"/>
|
||||
</a>
|
||||
<ul class="nav navbar-nav pull-right visible-xs">
|
||||
<li class="dropdown profile-dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="__STATIC__/images/samples/scarlet-159.png" alt=""/>
|
||||
<img src="__img__/samples/scarlet-159.png" alt=""/>
|
||||
<span class="hidden-xs">{:session('user_auth.username')}</span> <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
@@ -39,7 +39,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{:config('WEB_SITE_URL')}" target="_blank">
|
||||
<a href="/" target="_blank">
|
||||
<i class="fa fa-home"></i>
|
||||
前台首页
|
||||
</a>
|
||||
@@ -70,7 +70,7 @@
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li class="dropdown profile-dropdown hidden-sm hidden-xs">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="__STATIC__/images/samples/scarlet-159.png" alt=""/>
|
||||
<img src="__img__/samples/scarlet-159.png" alt=""/>
|
||||
<span class="hidden-xs">{:session('user_auth.username')}</span> <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
@@ -93,7 +93,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{:config('WEB_SITE_URL')}" target="_blank">
|
||||
<a href="/" target="_blank">
|
||||
<i class="fa fa-home"></i>
|
||||
前台首页
|
||||
</a>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.css">
|
||||
<script src="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.js"></script>
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugs/nanoscroller/nanoscroller.css">
|
||||
<script src="__STATIC__/plugs/nanoscroller/jquery.nanoscroller.min.js"></script>
|
||||
<script src="__STATIC__/js/bootstrap.js"></script>
|
||||
<script src="__STATIC__/plugs/jquery/pace.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="__static__/plugins/nanoscroller/nanoscroller.css">
|
||||
<script src="__static__/plugins/nanoscroller/jquery.nanoscroller.min.js"></script>
|
||||
<script src="__static__/common/js/bootstrap.js"></script>
|
||||
<script src="__static__/plugins/jquery/pace.min.js"></script>
|
||||
|
||||
<script src="__STATIC__/js/hopscotch.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/css/libs/hopscotch.css">
|
||||
<script src="__static__/common/js/hopscotch.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="__static__/common/css/hopscotch.css">
|
||||
|
||||
<script src="__STATIC__/js/messager.js"></script>
|
||||
<script src="__STATIC__/js/admin/app.js"></script>
|
||||
<script src="__static__/common/js/messager.js"></script>
|
||||
<script src="__js__/app.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
var SentCMS = window.Sent = {
|
||||
"ROOT" : "__ROOT__", //当前网站地址
|
||||
"APP" : "__APP__", //当前项目地址
|
||||
"PUBLIC" : "__STATIC__", //项目公共目录地址
|
||||
"DEEP" : "{:config('URL_PATHINFO_DEPR')}", //PATHINFO分割符
|
||||
"MODEL" : ["{:config('URL_MODEL')}", "{:config('URL_CASE_INSENSITIVE')}", "{:config('URL_HTML_SUFFIX')}"],
|
||||
"VAR" : ["{:config('VAR_MODULE')}", "{:config('VAR_CONTROLLER')}", "{:config('VAR_ACTION')}"]
|
||||
"PUBLIC" : "__static__", //项目公共目录地址
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="__STATIC__/js/core.js"></script>
|
||||
<script src="__static__/common/js/core.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,7 +13,7 @@
|
||||
<script type="text/javascript" src="__static__/plugins/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="__static__/plugins/layui/layui.all.js"></script>
|
||||
<script type="text/javascript">
|
||||
//var BASE_URL = "{:config('base_url')}"; //根目录地址
|
||||
//var BASE_URL = "/"; //根目录地址
|
||||
$(function(){
|
||||
var height = $(window).height();
|
||||
if ($('#content-wrapper').height() < height) {
|
||||
|
||||
@@ -48,4 +48,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__STATIC__/js/admin/skin-changer.js"></script>
|
||||
<script src="__js__/skin-changer.js"></script>
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/bootstrap-editable.css">
|
||||
{/block}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box no-header clearfix">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{extend name="public/base"/}
|
||||
{extend name="admin/public/base"/}
|
||||
{block name="body"}
|
||||
<div class="main-box no-header clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
@@ -70,8 +70,8 @@
|
||||
<td>
|
||||
<span >{$item['mobile']}</span>
|
||||
</td>
|
||||
<td>{$item['group_list']|implode=',',###}</td>
|
||||
<td>{$item['reg_time']|date='Y-m-d',###}</td>
|
||||
<td></td>
|
||||
<td>{$item['reg_time']}</td>
|
||||
<td class="text-center">
|
||||
{if condition="$item['status']"}
|
||||
<span class="label label-primary">启用</span>
|
||||
|
||||
Reference in New Issue
Block a user