no message

This commit is contained in:
听雨 2020-04-01 09:59:41 +08:00
parent f20b8f8bc3
commit a151be4cdf
108 changed files with 9876 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/.idea
/.vscode
/vendor
*.log
.env

42
.travis.yml Normal file
View File

@ -0,0 +1,42 @@
sudo: false
language: php
branches:
only:
- stable
cache:
directories:
- $HOME/.composer/cache
before_install:
- composer self-update
install:
- composer install --no-dev --no-interaction --ignore-platform-reqs
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
script:
- php think unit
deploy:
provider: releases
api_key:
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
file:
- ThinkPHP_Core.zip
- ThinkPHP_Full.zip
skip_cleanup: true
on:
tags: true

32
LICENSE.txt Normal file
View File

@ -0,0 +1,32 @@
ThinkPHP遵循Apache2开源协议发布并提供免费使用。
版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
All rights reserved。
ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
Apache Licence是著名的非盈利开源组织Apache采用的协议。
该协议和BSD类似鼓励代码共享和尊重原作者的著作权
允许代码修改,再作为开源或商业软件发布。需要满足
的条件:
1 需要给代码的用户一份Apache Licence
2 如果你修改了代码,需要在被修改的文件中说明;
3 在延伸的代码中(修改和有源代码衍生的代码中)需要
带有原来代码中的协议,商标,专利声明和其他原来作者规
定需要包含的说明;
4 如果再发布的产品中包含一个Notice文件则在Notice文
件中需要带有本协议内容。你可以在Notice中增加自己的
许可但不可以表现为对Apache Licence构成更改。
具体的协议参考http://www.apache.org/licenses/LICENSE-2.0
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

62
README.md Normal file
View File

@ -0,0 +1,62 @@
vaeThink 2.0
===============
## 介绍
本项目是面向PHP开发者的轻量级内容管理(权限管理)框架
本项目采用ThinkPHP6.X + Layui2.X开发
本项目包含了权限、多角色、菜单、路由、配置、内容管理等几乎每个项目都需要的基础性功能
本项目旨在帮助开发者们直接开始自己的业务逻辑开发
> 运行环境要求PHP7.1+。
## 特性
* 包含所有ThinkPHP6.X的特性
* 包含所有Layui2.X的特性
* 原汁原味的ThinkPHP6体验
* 帮助开发者直接开始自己的业务逻辑
## 安装
~~~
1.请配置域名指向项目的public目录
2.访问你配置的域名并完成安装引导
~~~
如果需要更新ThinkPHP框架请使用
~~~
composer update topthink/framework
~~~
如果需要更新Layui框架请使用
~~~
1.下载最新的Layui
2.替换public/static/admin_static/lib/layui下的所有文件
~~~
## 文档
[ThinkPHP6.X完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
[Layui2.X完全开发手册](https://www.layui.com/doc/)
## 版权
vaeThink遵循Apache2开源协议发布并提供免费使用。
本项目包含的第三方源码和二进制文件之版权信息另行标注。
版权所有Copyright © 2018-2020 by vaeThink (http://vaethink.com)
All rights reserved。
## 鸣谢
感谢ThinkPHP
感谢Layui
感谢所有支持者。

1
app/.htaccess Normal file
View File

@ -0,0 +1 @@
deny from all

99
app/BaseController.php Normal file
View File

@ -0,0 +1,99 @@
<?php
declare (strict_types = 1);
namespace app;
use think\App;
use think\exception\ValidateException;
use think\Validate;
/**
* 控制器基础类
*/
abstract class BaseController
{
/**
* Request实例
* @var \think\Request
*/
protected $request;
/**
* 应用实例
* @var \think\App
*/
protected $app;
/**
* 是否批量验证
* @var bool
*/
protected $batchValidate = false;
/**
* 控制器中间件
* @var array
*/
protected $middleware = [];
/**
* 构造方法
* @access public
* @param App $app 应用对象
*/
public function __construct(App $app)
{
//允许跨域访问
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:POST');
header('Access-Control-Allow-Headers:x-requested-with,content-type');
$this->app = $app;
$this->request = $this->app->request;
// 控制器初始化
$this->initialize();
}
// 初始化
protected function initialize()
{}
/**
* 验证数据
* @access protected
* @param array $data 数据
* @param string|array $validate 验证器名或者验证规则数组
* @param array $message 提示信息
* @param bool $batch 是否批量验证
* @return array|string|true
* @throws ValidateException
*/
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
{
if (is_array($validate)) {
$v = new Validate();
$v->rule($validate);
} else {
if (strpos($validate, '.')) {
// 支持场景
list($validate, $scene) = explode('.', $validate);
}
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
$v = new $class();
if (!empty($scene)) {
$v->scene($scene);
}
}
$v->message($message);
// 是否批量验证
if ($batch || $this->batchValidate) {
$v->batch(true);
}
return $v->failException(true)->check($data);
}
}

58
app/ExceptionHandle.php Normal file
View File

@ -0,0 +1,58 @@
<?php
namespace app;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\Handle;
use think\exception\HttpException;
use think\exception\HttpResponseException;
use think\exception\ValidateException;
use think\Response;
use Throwable;
/**
* 应用异常处理类
*/
class ExceptionHandle extends Handle
{
/**
* 不需要记录信息(日志)的异常类列表
* @var array
*/
protected $ignoreReport = [
HttpException::class,
HttpResponseException::class,
ModelNotFoundException::class,
DataNotFoundException::class,
ValidateException::class,
];
/**
* 记录异常信息(包括日志或者其它方式记录)
*
* @access public
* @param Throwable $exception
* @return void
*/
public function report(Throwable $exception): void
{
// 使用内置的方式记录异常日志
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @access public
* @param \think\Request $request
* @param Throwable $e
* @return Response
*/
public function render($request, Throwable $e): Response
{
// 添加自定义异常处理机制
// 其他错误交给系统处理
return parent::render($request, $e);
}
}

8
app/Request.php Normal file
View File

@ -0,0 +1,8 @@
<?php
namespace app;
// 应用请求对象类
class Request extends \think\Request
{
}

View File

@ -0,0 +1,118 @@
<?php
declare (strict_types = 1);
namespace app\admin;
use think\App;
use think\Validate;
use think\facade\Session;
use think\exception\ValidateException;
/**
* 控制器基础类
*/
abstract class BaseController
{
/**
* Request实例
* @var \think\Request
*/
protected $request;
/**
* 应用实例
* @var \think\App
*/
protected $app;
/**
* 是否批量验证
* @var bool
*/
protected $batchValidate = false;
/**
* 控制器中间件
* @var array
*/
protected $middleware = [];
/**
* 构造方法
* @access public
* @param App $app 应用对象
*/
public function __construct(App $app)
{
$this->app = $app;
$this->request = $this->app->request;
// 控制器初始化
$this->initialize();
}
// 初始化
protected function initialize()
{
$this->user = Session::get('adminToken');
$this->param = $this->request->param();
// Session::delete('adminToken');
}
/**
* 验证数据
* @access protected
* @param array $data 数据
* @param string|array $validate 验证器名或者验证规则数组
* @param array $message 提示信息
* @param bool $batch 是否批量验证
* @return array|string|true
* @throws ValidateException
*/
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
{
if (is_array($validate)) {
$v = new Validate();
$v->rule($validate);
} else {
if (strpos($validate, '.')) {
// 支持场景
list($validate, $scene) = explode('.', $validate);
}
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
$v = new $class();
if (!empty($scene)) {
$v->scene($scene);
}
}
$v->message($message);
// 是否批量验证
if ($batch || $this->batchValidate) {
$v->batch(true);
}
try {
$v->failException(true)->check($data);
} catch (\Exception $e) {
return vae_assign(202,$e->getMessage());
}
// 系统默认认为需要验证的表单同样需要验证令牌
$this->checkFormToken();
// return $v->failException(true)->check($data);
}
protected function checkFormToken()
{
$check = $this->request->checkToken('__token__', $this->request->param());
if(false === $check) {
return vae_assign(202, '令牌无效,请刷新页面');
}
// ...
}
}

90
app/admin/common.php Normal file
View File

@ -0,0 +1,90 @@
<?php
// 这是系统自动生成的公共文件
use think\facade\Request;
//针对layui数据列表的返回数据方法
function vae_table_assign($code=0, $msg='', $data, $httpCode=200, $header = [], $options = []){
$res['code'] = $code;
$res['msg'] = $msg;
if(is_object($data)) {
$data = $data->toArray();
}
if(!empty($data['total'])){
$res['count'] = $data['total'];
} else {
$res['count'] = 0;
}
$res['data'] = $data['data'];
$response = \think\Response::create($res, "json",$httpCode, $header, $options);
throw new \think\exception\HttpResponseException($response);
}
//接收参数方法,方便后期解密
function vae_input($name='')
{
if($name) {
$param = Request::param($name);
}
else
{
$param = Request::param();
}
return $param;
}
//随机字符串默认长度10
function vae_set_salt($num = 10){
$str = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890';
$salt = substr(str_shuffle($str), 10, $num);
return $salt;
}
//递归排序
function vae_set_recursion($result,$pid=0,$format="L "){
/*记录排序后的类别数组*/
static $list=array();
foreach ($result as $k => $v){
if($v['pid']==$pid){
if($pid!=0){
$v['title']=' '.$format.$v['title'];
}
/*将该类别的数据放入list中*/
$list[]=$v;
vae_set_recursion($result,$v['id'],"  ".$format);
}
}
return $list;
}
function vae_list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'children', $root = 0)
{
// 创建Tree
$tree = array();
if (is_array($list)) {
// 创建基于主键的数组引用
$refer = array();
foreach ($list as $key => $data) {
$refer[$data[$pk]] =& $list[$key];
}
foreach ($list as $key => $data) {
// 判断是否存在parent
$parentId = $data[$pid];
if ($root == $parentId) {
$tree[] =& $list[$key];
} else {
if (isset($refer[$parentId])) {
$parent =& $refer[$parentId];
$parent[$child][] =& $list[$key];
}
}
}
}
return $tree;
}
//vaeThink加密方式
function vae_set_password($pwd, $salt){
return md5(md5($pwd.$salt).$salt);
}

View File

@ -0,0 +1,19 @@
<?php
// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------
return [
// session name
'name' => 'PHPSESSID',
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',
// 驱动方式 支持file cache
'type' => 'file',
// 存储连接标识 当type使用cache的时候有效
'store' => null,
// 过期时间
'expire' => 1440,
// 前缀
'prefix' => 'VAE_ADMIN_',
];

28
app/admin/config/view.php Normal file
View File

@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'template',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
'tpl_replace_string' => [
'__AVIEW__' => '/static/admin_static'
]
];

View File

@ -0,0 +1,164 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\View;
use think\facade\Session;
class Admin extends BaseController
{
/**
* 管理员列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$where = [];
if(!empty($param['keywords'])) {
$where[] = ['nickname|username|desc','like',$param['keywords'].'%'];
}
$list = Db::name('admin')
->field('id,username,nickname,status,last_login_time,desc,thumb,groups,last_login_ip')
->where($where)
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
])
->each(function($item, $key){
$item['groupName'] = implode('|',Db::name('admin_group')->where('id','in',explode(',',$item['groups']))->column('title'));
$item['last_login_time'] = date('Y-m-d H:i:s',$item['last_login_time']);
return $item;
});
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加管理员
* @Author 听雨
* @DateTime 2019-11-21
*/
public function add()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'username' => 'require|unique:admin',
'password' => 'require|confirm',
'nickname' => 'require',
'thumb' => 'require',
'group_id' => 'require',
]);
$param['salt'] = vae_set_salt(20);
$param['pwd'] = vae_set_password($param['password'],$param['salt']);
$param['groups'] = implode(',',$param['group_id']);
$param['create_time'] = time();
if(false == Db::name('admin')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('group',Db::name('admin_group')->where('status',1)->select()->toArray());
return View::fetch();
}
}
/**
* 修改管理员
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function edit()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'nickname' => 'require',
'thumb' => 'require',
'group_id' => 'require',
]);
// 不允许其他管理员修改id=1的管理员
if($param['id'] == 1 and Session::get('admin_tiken')['id'] !== 1)
{
return vae_assign(202,'不允许其他人修改系统所有者');
}
unset($param['username']);
if(!empty($param['password'])) {
//重置密码
if(empty($param['password_confirm']) or $param['password_confirm'] !== $param['password']) {
return vae_assign(202,'两次密码不一致');
}
$param['salt'] = vae_set_salt(20);
$param['pwd'] = vae_set_password($param['password'],$param['salt']);
} else {
unset($param['pwd']);
unset($param['salt']);
}
$param['groups'] = implode(',',$param['group_id']);
$param['update_time'] = time();
if(false == Db::name('admin')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
Cache::delete('uRulesSrc'.$param['id']);
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('admin')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):$data['groups']=explode(',', $data['groups']);
View::assign('data',$data);
View::assign('group',Db::name('admin_group')->where('status',1)->select()->toArray());
return View::fetch();
}
}
/**
* 删除管理员
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function delete()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if ($id == 1) {
return vae_assign(202,"系统拥有者,无法删除!");
}
if (Db::name('admin')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除管理员成功!");
}
}

View File

@ -0,0 +1,213 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
class Cate extends BaseController
{
/**
* 分组列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$list = Db::name('cate_group')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加导航组
* @Author 听雨
* @DateTime 2019-11-21
*/
public function addGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'name' => 'require|unique:cate_group',
'key' => 'require|unique:cate_group',
]);
if(false == Db::name('cate_group')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
return View::fetch();
}
}
/**
* 修改导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function editGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'name' => 'require|unique:cate_group',
'key' => 'require|unique:cate_group',
]);
if(false == Db::name('cate_group')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('cate_group')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
/**
* 删除导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function deleteGroup()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$count = Db::name('cate')->where(["cate_group_id" => $id])->count();
if ($count > 0) {
return vae_assign(202,"该分组下还存在分类,请先删除分类数据");
}
if (Db::name('cate_group')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
public function cateIndex()
{
$param = $this->param;
if($this->request->isAjax())
{
if(empty($param['cate_group_id']))
{
return vae_assign(202,'非法请求');
}
$list = Db::name('cate')
->where('cate_group_id',$param['cate_group_id'])
->order('sort desc')
->select()
->toArray();
return vae_assign(0,'',vae_set_recursion($list));
}
else
{
View::assign('cate_group_id',$param['cate_group_id']);
return View::fetch();
}
}
public function addCate()
{
$param = $this->param;
if($this->request->isPost())
{
$this->validate($param,[
'title' => 'require',
'cate_group_id' => 'require',
'pid' => 'require'
]);
if(false == Db::name('cate')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('cate_group_id',$param['cate_group_id']);
View::assign('cate',Db::name('cate')->where('cate_group_id',$param['cate_group_id'])->select()->toArray());
return View::fetch();
}
}
public function editCate()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'title' => 'require',
'pid' => 'require'
]);
if(false == Db::name('cate')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('cate')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
View::assign('cate',Db::name('cate')->where('cate_group_id',$data['cate_group_id'])->select()->toArray());
return View::fetch();
}
}
public function deleteCate()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if(Db::name('cate')->where('pid',$id)->count() > 0) {
return vae_assign(202,'删除失败,该分类下还存在子分类');
}
if (Db::name('cate')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
}

View File

@ -0,0 +1,146 @@
<?php
// +----------------------------------------------------------------------
// | vaeThink [ Programming makes me happy ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://www.vaeThink.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +---------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Config;
use think\facade\View;
class Conf extends BaseController
{
/**
* 配置首页
* @Author 听雨
* @DateTime 2020-03-16
* @return [type] [description]
*/
public function index()
{
// web配置
$webconf = Config::get('web');
View::assign('webConf',[
'title' => empty($webconf['title']) ? '' : $webconf['title'],
'keywords' => empty($webconf['keywords']) ? '' : $webconf['keywords'],
'desc' => empty($webconf['desc']) ? '' : $webconf['desc'],
'logo' => empty($webconf['logo']) ? '' : $webconf['logo'],
'icp' => empty($webconf['icp']) ? '' : $webconf['icp'],
'code' => empty($webconf['code']) ? '' : $webconf['code'],
]);
// email配置
$emailconf = Config::get('email');
View::assign('emailConf',[
'smtp' => empty($emailconf['smtp']) ? '' : $emailconf['smtp'],
'username' => empty($emailconf['username']) ? '' : $emailconf['username'],
'password' => empty($emailconf['password']) ? '' : $emailconf['password'],
'port' => empty($emailconf['port']) ? '' : $emailconf['port'],
'email' => empty($emailconf['email']) ? '' : $emailconf['email'],
'from' => empty($emailconf['from']) ? '' : $emailconf['from'],
]);
// 大鱼配置
$dayuconf = Config::get('dayu');
View::assign('dayuConf',[
'appkey' => empty($dayuconf['appkey']) ? '' : $dayuconf['appkey'],
'secretkey' => empty($dayuconf['secretkey']) ? '' : $dayuconf['secretkey'],
'FreeSignName' => empty($dayuconf['FreeSignName']) ? '' : $dayuconf['FreeSignName']
]);
return View::fetch();
}
/**
* 配置提交
* @Author 听雨
* @DateTime 2020-03-16
* @return [type] [description]
*/
public function confSubmit()
{
$param = $this->param;
switch ($param['type']) {
case 'web':
$this->webConfSubmit($param);
break;
case 'email':
$this->emailConfSubmit($param);
break;
default:
$this->dayuConfSubmit($param);
break;
}
}
//提交网站信息
private function webConfSubmit($param)
{
$this->validate($param,[
'title|网站标题' => 'require',
]);
$conf = "<?php return ['title'=>'{$param["title"]}','keywords'=>'{$param["keywords"]}','logo'=>'{$param["logo"]}','desc'=>'{$param["desc"]}','icp'=>'{$param["icp"]}','code'=>'{$param["code"]}'];";
try {
file_put_contents(config_path() . "web.php",$conf);
} catch (\Exception $e) {
return vae_assign(202,'配置失败:'.$e->getMessage());
}
return vae_assign(200,'配置成功');
}
//提交邮箱配置
private function emailConfSubmit($param)
{
$this->validate($param,[
'smtp|smtp服务器' => 'require',
'username|账户' => 'require',
'password|密码' => 'require',
'port|端口' => 'require',
'email|发件邮箱' => 'require',
'from|发件人' => 'require',
]);
$conf = "<?php return ['smtp'=>'{$param["smtp"]}','username'=>'{$param["username"]}','password'=>'{$param["password"]}','port'=>'{$param["port"]}','email'=>'{$param["email"]}','from'=>'{$param["from"]}'];";
try {
file_put_contents(config_path() . "email.php",$conf);
} catch (\Exception $e) {
return vae_assign(202,'配置失败:'.$e->getMessage());
}
return vae_assign(200,'配置成功');
}
//提交大鱼短信配置
private function dayuConfSubmit($param)
{
$this->validate($param,[
'appkey' => 'require',
'secretkey' => 'require',
'FreeSignName|签名' => 'require',
]);
$conf = "<?php return ['appkey'=>'{$param["appkey"]}','secretkey'=>'{$param["secretkey"]}','FreeSignName'=>'{$param["FreeSignName"]}'];";
try {
file_put_contents(config_path() . "dayu.php",$conf);
} catch (\Exception $e) {
return vae_assign(202,'配置失败:'.$e->getMessage());
}
return vae_assign(200,'配置成功');
}
}

View File

@ -0,0 +1,225 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
class Content extends BaseController
{
/**
* 分组列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$list = Db::name('content_group')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加导航组
* @Author 听雨
* @DateTime 2019-11-21
*/
public function addGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'name' => 'require|unique:content_group',
'key' => 'require|unique:content_group',
'cate_group_id' => 'require',
]);
if(false == Db::name('content_group')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('cate_group',Db::name('cate_group')->select()->toArray());
return View::fetch();
}
}
/**
* 修改导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function editGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'name' => 'require|unique:content_group',
'key' => 'require|unique:content_group',
'cate_group_id' => 'require',
]);
if(false == Db::name('content_group')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('content_group')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
View::assign('cate_group',Db::name('cate_group')->select()->toArray());
return View::fetch();
}
}
/**
* 删除导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function deleteGroup()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$count = Db::name('content')->where(["content_group_id" => $id])->count();
if ($count > 0) {
return vae_assign(202,"该分组下还存在内容,请先删除内容数据");
}
if (Db::name('content_group')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
public function contentIndex()
{
$param = $this->param;
if($this->request->isAjax())
{
if(empty($param['content_group_id']))
{
return vae_assign(202,'非法请求');
}
$list = Db::name('content')
->where('content_group_id',$param['content_group_id'])
->order('sort create_time desc')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
])
->each(function($item, $key){
// $item['img'] = explode(',',$item['img']);
$item['create_time'] = date('Y-m-d',$item['create_time']);
$item['cate_name'] = Db::name('cate')->where('id',$item['cate_id'])->value('title');
return $item;
});
return vae_table_assign(0,'',$list);
}
else
{
View::assign('content_group_id',$param['content_group_id']);
return View::fetch();
}
}
public function addContent()
{
$param = $this->param;
if($this->request->isPost())
{
$this->validate($param,[
'title' => 'require',
'img' => 'require',
'content_group_id' => 'require',
]);
// $param['img'] = implode(',', $param['img']);
if(false == Db::name('content')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('content_group_id',$param['content_group_id']);
View::assign('cate',Db::name('cate')->where('cate_group_id',Db::name('content_group')->where('id',$param['content_group_id'])->value('cate_group_id'))->select()->toArray());
return View::fetch();
}
}
public function editContent()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'title' => 'require',
'img' => 'require',
]);
if(false == Db::name('content')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('content')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
View::assign('cate',Db::name('cate')->where('cate_group_id',Db::name('content_group')->where('id',$data['content_group_id'])->value('cate_group_id'))->select()->toArray());
return View::fetch();
}
}
public function deleteContent()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if (Db::name('content')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
}

View File

@ -0,0 +1,139 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\View;
class Group extends BaseController
{
/**
* 权限组
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$where = [];
if(!empty($param['keywords'])) {
$where[] = ['title|desc','like',$param['keywords'].'%'];
}
$list = Db::name('admin_group')
->field('id,title,status,desc')
->where($where)
->paginate([
'list_rows' => isset($param['list_rows']) ? $param['list_rows'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加权限组
* @Author 听雨
* @DateTime 2019-11-21
*/
public function add()
{
if($this->request->isAjax())
{
$param = $this->param;
$this->validate($param,[
'title' => 'require|unique:admin_group',
]);
$param['rules'] = empty($param['rules'])?'':implode(',',$param['rules']);
$param['create_time'] = time();
if(false == Db::name('admin_group')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
return View::fetch();
}
}
/**
* 修改权限组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function edit()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'title' => 'require|unique:admin_group',
]);
$param['rules'] = empty($param['rules'])?'':implode(',',$param['rules']);
$param['update_time'] = time();
if(false == Db::name('admin_group')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
Cache::tag('adminRulesSrc')->clear();
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$group = Db::name('admin_group')->find($id);
if(empty($group)) {
return vae_assign(202,'查询的数据不存在');
}
// 为了配合layui的tree组件存在的bug这里将已勾选的id倒叙
$group['rules'] = array_reverse(explode(',',$group['rules']));
View::assign('group',$group);
return View::fetch();
}
}
/**
* 删除权限组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function delete()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if (Db::name('admin_group')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
Cache::tag('adminRulesSrc')->clear();
return vae_assign(200,"删除成功!");
}
}

View File

@ -0,0 +1,256 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\View;
use think\facade\Session;
use think\facade\Config;
class Index extends BaseController
{
/**
* 后台首页
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
View::assign('uInfo',Session::get('adminToken'));
return View::fetch();
}
/**
* 后台默认打开的控制台页面
* @Author 听雨
* @DateTime 2020-03-07
* @return [type] [description]
*/
public function console()
{
return View::fetch();
}
/**
* 后台菜单接口
* @Author 听雨
* @DateTime 2020-03-07
* @return [type] [description]
*/
public function getAdminMenuList()
{
// Cache::delete('uRulesMenu'.$this->user['id']);
if(!Cache::get('uRulesMenu'.$this->user['id']))
{
//用户所在权限组及所拥有的权限
if($this->user['id'] == 1)
{
//id=1的管理员默认拥有所有权限
$uRulesMenu = Db::name('admin_rule')->where('is_menu',1)->order('sort desc')->field('id,pid,title,src as href,font_family as fontFamily,icon')->select()->toArray();
}
else
{
$uGroupIds = explode(',',Db::name('admin')->where('id',$this->user['id'])->value('groups'));
$uRuleIds = Db::name('admin_group')->where('id','IN',$uGroupIds)->where('status',1)->column('rules','id');
$uRules = [];
foreach ($uRuleIds as $k => $v) {
$uRules = array_keys(array_flip($uRules)+array_flip(explode(',',$v)));
}
//用户所拥有的所有菜单
$uRulesMenu = Db::name('admin_rule')->where('id','in',$uRules)->where('is_menu',1)->order('sort desc')->field('id,pid,title,src as href,font_family as fontFamily,icon')->select()->toArray();
}
foreach ($uRulesMenu as $k => $v) {
if(!empty($v['href'])) {
$uRulesMenu[$k]['href'] = (string)url($v['href']);
}
}
// 在菜单列表的开头添加首页
array_unshift($uRulesMenu,['id'=>-1,'pid'=>0,'title'=>'首页','href'=>'','fontFamily'=>'','icon'=>'layui-icon-home']);
array_push($uRulesMenu,['id'=>-2,'pid'=>0,'title'=>'文档','href'=>'http://vaethink.com','fontFamily'=>'','icon'=>'layui-icon-read']);
$uRulesMenu = vae_list_to_tree($uRulesMenu);
Cache::tag('adminRulesSrc')->set('uRulesMenu'.$this->user['id'],$uRulesMenu,36000);
}
$uRulesMenu = Cache::get('uRulesMenu'.$this->user['id']);
return vae_assign(200,'',$uRulesMenu);
}
/**
* 清空系统缓存
* @Author 听雨
* @DateTime 2020-03-09
* @return [type] [description]
*/
public function cacheClear()
{
try {
Cache::clear();
} catch (\Exception $e) {
return vae_assign(202,$e->getMessage());
}
return vae_assign(200,'清除成功');
}
/**
* 管理员退出登录
* @Author 听雨
* @DateTime 2020-03-07
* @return [type] [description]
*/
public function adminLogout()
{
try {
Session::delete('adminToken');
} catch (\Exception $e) {
return vae_assign(202,$e->getMessage());
}
return vae_assign(200,'已为您注销登录,再会!',(string)url('admin/publicer/adminLoginPage'));
}
/**
* 权限节点,用于添加和修改权限组
* @Author 听雨
* @DateTime 2020-03-11
* @return [type] [description]
*/
public function getRuleList()
{
if($this->request->isAjax())
{
$list = Db::name('admin_rule')
->field('id,pid,title,is_menu')
->select()
->toArray();
// 配合layui树形组件提供的额外数据
foreach ($list as $k => $v) {
// 默认全部展开
// $list[$k]['spread'] = true;
// 标注菜单和纯权限节点
$v['is_menu'] == 1?$list[$k]['title'] = '<span class="layui-badge">权限</span> <span class="layui-badge layui-bg-blue">菜单</span> ' . $v['title']:$list[$k]['title'] = '<span class="layui-badge">权限</span> ' . $v['title'];
// if(!empty($this->param['id'])){
// $sele = explode(',',Db::name('admin_group')->where('id',$this->param['id'])->value('rules'));
// if(in_array($v['id'], $sele)){
// // $list[$k]['checked'] = true;
// }else{
// $list[$k]['checked'] = false;
// }
// }
}
return vae_assign(200,'',vae_list_to_tree($list));
}
else
{
return vae_assign(202,'非法请求');
}
}
/**
* 文件上传
* @Author 听雨
* @DateTime 2019-12-04
* @return [type] [description]
*/
public function upload(){
// 获取表单上传文件 例如上传了001.jpg
$param['image'] = request()->file('file');
// dump($param['image']);die;
$validate = \think\facade\Validate::rule([
'image' => 'require|fileSize:102400|fileExt:jpg,png,jpeg,gif',
]);
if (!$validate->check($param)) {
return vae_assign(202,$validate->getError());
}
//
$file = $param['image'];
$savename = \think\facade\Filesystem::disk('public')->putFile( 'topic', $file);
if($savename) {
$path = Config::get('filesystem.disks.public.url');
$data = $path.'/'.$savename;
return vae_assign(200,'上传成功',$data);
}
else
{
return vae_assign(202,'上传失败,请稍后再试');
}
}
/**
* 异常提示页
* @Author 听雨
* @DateTime 2020-03-12
* @param string $msg [description]
* @return [type] [description]
*/
public function errorShow($msg = '你没有这个操作的权限呀~')
{
View::assign('msg',$msg);
return View::fetch();
}
/**
* 修改个人资料
* @Author 听雨
* @DateTime 2020-03-12
* @return [type] [description]
*/
public function editAdminInfo()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'nickname' => 'require',
'thumb' => 'require',
]);
if(!empty($param['password']))
{
//重置密码
if(empty($param['password_confirm']) or $param['password_confirm'] !== $param['password']) {
return vae_assign(202,'两次密码不一致');
}
$param['salt'] = vae_set_salt(20);
$param['pwd'] = vae_set_password($param['password'],$param['salt']);
}
else
{
unset($param['pwd']);
unset($param['salt']);
}
$param['update_time'] = time();
$param['id'] = Session::get('adminToken')['id'];
unset($param['groups']);
if(false == Db::name('admin')->strict(false)->field(true)->update($param))
{
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功,重新登录后生效');
}
else
{
View::assign('admin',Session::get('adminToken'));
return View::fetch('admin@admin/edit_admin_info');
}
}
}

View File

@ -0,0 +1,141 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\View;
class Menu extends BaseController
{
/**
* 列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$where = [];
if(!empty($param['keywords'])) {
// dump($param['keywords']);die;
$where[] = ['title','like',$this->param['keywords'].'%'];
}
$list = Db::name('admin_rule')
->field('id,pid,title,is_menu')
->where($where)
->select()
->toArray();
// 配合layui树形组件提供的额外数据
foreach ($list as $k => $v) {
// 默认全部展开
// $list[$k]['spread'] = true;
// 标注菜单和纯权限节点
$v['is_menu'] == 1?$list[$k]['title'] = '<span class="layui-badge">权限</span> <span class="layui-badge layui-bg-blue">菜单</span> ' . $v['title']:$list[$k]['title'] = '<span class="layui-badge">权限</span> ' . $v['title'];
}
return vae_assign(200,'',vae_list_to_tree($list));
}
else
{
return View::fetch();
}
}
/**
* 添加
* @Author 听雨
* @DateTime 2019-11-21
*/
public function add()
{
if($this->request->isAjax()) {
$param = $this->param;
$this->validate($param,[
'pid' => 'require',
'title' => 'require',
]);
$param['is_menu'] = empty($param['is_menu'])?0:$param['is_menu'];
if(false == Db::name('admin_rule')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
//清除所有菜单缓存
Cache::tag('adminRulesSrc')->clear();
return vae_assign(200,'添加成功');
} else {
View::assign('menu',Db::name('admin_rule')->select()->toArray());
return View::fetch();
}
}
/**
* 修改
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function edit()
{
if($this->request->isPost()) {
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'pid' => 'require',
'title' => 'require',
]);
$param['is_menu'] = empty($param['is_menu'])?0:$param['is_menu'];
if(false == Db::name('admin_rule')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
//清除所有菜单缓存
Cache::tag('adminRulesSrc')->clear();
return vae_assign(200,'修改成功');
} else {
$id = $this->param['id'];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$data = Db::name('admin_rule')->field('id,pid,title,src,is_menu,font_family,icon,sort')->find($id);
if(empty($data)) {
return vae_assign(202,'查询的数据不存在');
}
View::assign('data',$data);
View::assign('menu',Db::name('admin_rule')->select()->toArray());
return View::fetch();
}
}
/**
* 删除
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function delete()
{
$id = $this->param['id'];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$count = Db::name('admin_rule')->where(["pid" => $id])->count();
if ($count > 0) {
return vae_assign(202,"该菜单下还存在子菜单,请先删除子菜单!");
}
if (Db::name('admin_rule')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
}

View File

@ -0,0 +1,209 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
class Nav extends BaseController
{
/**
* 分组列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$list = Db::name('nav_group')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加导航组
* @Author 听雨
* @DateTime 2019-11-21
*/
public function addGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'name' => 'require|unique:nav_group',
'key' => 'require|unique:nav_group',
]);
if(false == Db::name('nav_group')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
return View::fetch();
}
}
/**
* 修改导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function editGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'name' => 'require|unique:nav_group',
'key' => 'require|unique:nav_group',
]);
if(false == Db::name('nav_group')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('nav_group')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
/**
* 删除导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function deleteGroup()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$count = Db::name('nav')->where(["nav_group_id" => $id])->count();
if ($count > 0) {
return vae_assign(202,"该分组下还存在导航,请先删除导航数据");
}
if (Db::name('nav_group')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
public function navIndex()
{
$param = $this->param;
if($this->request->isAjax())
{
if(empty($param['nav_group_id']))
{
return vae_assign(202,'非法请求');
}
$list = Db::name('nav')
->where('nav_group_id',$param['nav_group_id'])
->order('sort desc')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
View::assign('nav_group_id',$param['nav_group_id']);
return View::fetch();
}
}
public function addNav()
{
$param = $this->param;
if($this->request->isPost())
{
$this->validate($param,[
'title' => 'require',
'nav_group_id' => 'require',
]);
if(false == Db::name('nav')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('nav_group_id',$param['nav_group_id']);
return View::fetch();
}
}
public function editNav()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'title' => 'require',
]);
if(false == Db::name('nav')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('nav')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
public function deleteNav()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if (Db::name('nav')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
}

View File

@ -0,0 +1,66 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\Session;
use think\facade\View;
class Publicer extends BaseController
{
/**
* 实例化管理员登录页
* @Author 听雨
* @DateTime 2020-03-06
* @return [type] [description]
*/
public function adminLoginPage()
{
if(Session::has('adminToken')){
return redirect((string)url('/admin/index/index'));
}
return View::fetch();
}
/**
* 管理员登录
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function adminLoginSubmit()
{
$param = $this->param;
$this->validate($param,[
// 'captcha|验证码'=>'require|captcha',
'username|用户名' => 'require',
'password|密码' => 'require'
]);
$admin = Db::name('admin')->where(['username'=>$param['username']])->find();
if(empty($admin)) {
return vae_assign(202,'用户名或密码错误');
}
$param['pwd'] = vae_set_password($param['password'],$admin['salt']);
if($admin['pwd'] !== $param['pwd']) {
return vae_assign(202,'用户名或密码错误');
}
if($admin['status'] == 0){
return vae_assign(202,'该用户禁止登陆,请于系统所有者联系');
}
Session::set('adminToken', [
'id' => $admin['id'],
'thumb' => $admin['thumb'],
'nickname' => $admin['nickname']
]);
$data = [
'last_login_time' => time(),
'last_login_ip' => $this->request->ip(),
];
Db::name('admin')->where(['id'=>$admin['id']])->update($data);
return vae_assign(200,'登入成功');
}
}

View File

@ -0,0 +1,132 @@
<?php
// +----------------------------------------------------------------------
// | vaeThink [ Programming makes me happy ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://www.vaeThink.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +---------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
use think\facade\Cache;
class Route extends BaseController
{
/**
* 链接美化首页
* @Author 听雨
* @DateTime 2020-03-19
* @return [type] [description]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$where = array();
if(!empty($param['keywords'])) {
$where[] = ['id|full_url|url','like',$param['keywords'].'%'];
}
$route = Db::name('route')
->order('create_time asc')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$route);
}
else
{
return View::fetch();
}
}
/**
* 添加链接美化
* @Author 听雨
* @DateTime 2020-03-19
*/
public function add()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'module' => 'require',
'full_url' => 'require|unique:route',
'url' => 'require|unique:route',
]);
$param['create_time'] = time();
if(false == Db::name('route')->strict(false)->field(true)->insert($param))
{
return vae_assign(202,'创建失败,请稍后再试');
}
Cache::delete('route_'.$param['module']);
return vae_assign(200,'创建成功');
}
else
{
return View::fetch();
}
}
/**
* 修改链接美化
* @Author 听雨
* @DateTime 2020-03-19
* @return [type] [description]
*/
public function edit()
{
$param = $this->param;
if($this->request->isPost())
{
$this->validate($param,[
'module' => 'require',
'full_url' => 'require|unique:route',
'url' => 'require|unique:route',
'status' => 'require',
'id' => 'require',
]);
$param['update_time'] = time();
if(false == Db::name('route')->strict(false)->field(true)->update($param))
{
return vae_assign(202,'修改失败,请稍后再试');
}
Cache::delete('route_'.$param['module']);
return vae_assign(200,'修改成功');
}
else
{
$data = Db::name('route')->find($param['id']);
empty($data)?vae_assign('202','查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
/**
* 删除链接美化
* @Author 听雨
* @DateTime 2020-03-19
* @return [type] [description]
*/
public function delete()
{
$param = $this->param;
if (Db::name('Route')->delete($param['id']) !== false) {
Cache::delete('route_'.$param['module']);
return vae_assign(200,"删除成功!");
} else {
return vae_assign(202,"删除失败!");
}
}
}

View File

@ -0,0 +1,209 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
class Slide extends BaseController
{
/**
* 分组列表
* @Author 听雨
* @DateTime 2019-11-21
* @return [type]
*/
public function index()
{
if($this->request->isAjax())
{
$param = $this->param;
$list = Db::name('slide_group')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
return View::fetch();
}
}
/**
* 添加导航组
* @Author 听雨
* @DateTime 2019-11-21
*/
public function addGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'name' => 'require|unique:slide_group',
'key' => 'require|unique:slide_group',
]);
if(false == Db::name('slide_group')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
return View::fetch();
}
}
/**
* 修改导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function editGroup()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'name' => 'require|unique:slide_group',
'key' => 'require|unique:slide_group',
]);
if(false == Db::name('slide_group')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('slide_group')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
/**
* 删除导航组
* @Author 听雨
* @DateTime 2019-11-22
* @return [type] [description]
*/
public function deleteGroup()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
$count = Db::name('slide')->where(["slide_group_id" => $id])->count();
if ($count > 0) {
return vae_assign(202,"该分组下还存在轮播图,请先删除轮播图数据");
}
if (Db::name('slide_group')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
public function slideIndex()
{
$param = $this->param;
if($this->request->isAjax())
{
if(empty($param['slide_group_id']))
{
return vae_assign(202,'非法请求');
}
$list = Db::name('slide')
->where('slide_group_id',$param['slide_group_id'])
->order('sort desc')
->paginate([
'list_rows' => isset($param['limit']) ? $param['limit'] : 20,
'page' => isset($param['page']) ? $param['page'] : 1,
'query' => $param
]);
return vae_table_assign(0,'',$list);
}
else
{
View::assign('slide_group_id',$param['slide_group_id']);
return View::fetch();
}
}
public function addSlide()
{
$param = $this->param;
if($this->request->isPost())
{
$this->validate($param,[
'icon' => 'require',
'slide_group_id' => 'require',
]);
if(false == Db::name('slide')->strict(false)->field(true)->insert($param)) {
return vae_assign(202,'创建失败,请稍后再试');
}
return vae_assign(200,'创建成功');
}
else
{
View::assign('slide_group_id',$param['slide_group_id']);
return View::fetch();
}
}
public function editSlide()
{
if($this->request->isPost())
{
$param = $this->param;
$this->validate($param,[
'id' => 'require',
'icon' => 'require',
]);
if(false == Db::name('slide')->strict(false)->field(true)->update($param)) {
return vae_assign(202,'修改失败,请稍后再试');
}
return vae_assign(200,'修改成功');
}
else
{
$id = $this->param['id'];
$data = Db::name('slide')->find($id);
empty($data)?vae_assign(202,'查询的数据不存在'):View::assign('data',$data);
return View::fetch();
}
}
public function deleteSlide()
{
$id = $this->param["id"];
if(!$id) {
return vae_assign(202,'缺少必要条件');
}
if (Db::name('slide')->delete($id) == false) {
return vae_assign(202,"删除失败!");
}
return vae_assign(200,"删除成功!");
}
}

16
app/admin/event.php Normal file
View File

@ -0,0 +1,16 @@
<?php
// 事件定义文件
return [
'bind' => [
],
'listen' => [
'HttpRun' => [],
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
],
'subscribe' => [
],
];

10
app/admin/middleware.php Normal file
View File

@ -0,0 +1,10 @@
<?php
return [
//开启session中间件
'think\middleware\SessionInit',
//验证vaeThink是否完成安装
\app\admin\middleware\Install::class,
//验证管理员操作权限
\app\admin\middleware\Auth::class,
];

View File

@ -0,0 +1,93 @@
<?php
declare (strict_types = 1);
namespace app\admin\middleware;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Session;
use think\Ruquest;
class Auth
{
public function handle($request, \Closure $next)
{
$pathInfo = explode('/',str_replace('.'.$request->ext(),'',$request->pathInfo()));
if(count($pathInfo) !== 2)
{
// 由于中间件里不能正常使用$request->controller()获取用户访问的控制器及方法因此只能通过pathInfo来获取url并进行截取但这就要求用户访问时必须输入完整的url不然就抛出异常
return abort(202, '非法请求,请输入完整的url');
}
$controller = strtolower($pathInfo[0]);
$action = strtolower($pathInfo[1]);
//验证用户登录
if($controller !== 'publicer')
{
if(!Session::has('adminToken'))
{
return $request->isAjax()?vae_assign(404,'请先登录'):redirect((string)url('/admin/publicer/adminLoginPage'));
}
// 验证用户访问权限
if($controller !== 'index')
{
if(!$this->checkAuth($controller,$action,Session::get('adminToken')['id']))
{
return $request->isAjax()?vae_assign(202,'你没有权限!'):redirect((string)url('/admin/index/errorShow'));
}
}
}
return $next($request);
}
/**
* 验证用户访问权限
* @Author 听雨
* @DateTime 2019-11-21
* @param string $controller 当前访问控制器
* @param string $action 当前访问方法
* @param string $uid 当前用户id
* @return [type]
*/
protected function checkAuth($controller,$action,$uid)
{
// Cache::delete('uRulesSrc'.$uid);
if($uid == 1)
{
// id=1的管理员默认拥有所有权限
return true;
}
else
{
if(!Cache::get('uRulesSrc'.$uid))
{
//用户所在权限组及所拥有的权限
$uGroupIds = explode(',',Db::name('admin')->where('id',$uid)->value('groups'));
$uRuleIds = Db::name('admin_group')->where('id','IN',$uGroupIds)->where('status',1)->column('rules','id');
$uRules = [];
foreach ($uRuleIds as $k => $v) {
$uRules = array_keys(array_flip($uRules)+array_flip(explode(',',$v)));
}
//用户所拥有的所有权限节点
$uRulesSrc = Db::name('admin_rule')->where('id','in',$uRules)->column('src','id');
Cache::tag('adminRulesSrc')->set('uRulesSrc'.$uid,$uRulesSrc,36000);
}
else
{
$uRulesSrc = Cache::get('uRulesSrc'.$uid);
}
if(!in_array((string)$controller.'/'.$action, $uRulesSrc))
{
return false;
}
return true;
}
}
}

View File

@ -0,0 +1,17 @@
<?php
declare (strict_types = 1);
namespace app\admin\middleware;
class Install
{
public function handle($request, \Closure $next)
{
if(!file_exists(root_path() . 'install.lock'))
{
return $request->isAjax()?vae_assign(202,'请先完成系统安装引导'):redirect((string)url('/install/install/index'));
}
return $next($request);
}
}

5
app/admin/provider.php Normal file
View File

@ -0,0 +1,5 @@
<?php
// 这是系统自动生成的provider定义文件
return [
];

View File

@ -0,0 +1,113 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-block">
<input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">确认密码</label>
<div class="layui-input-inline">
<input type="password" name="password_confirm" lay-verify="required" placeholder="请再次输入密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">昵称</label>
<div class="layui-input-inline">
<input type="text" name="nickname" lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">头像</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传头像</button>
<div class="layui-upload-list" id="demo1">
<img src="" width="100" />
<input type="hidden" name="thumb" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">管理组</label>
<div class="layui-input-block">
{volist name="$group" id="v"}
<input type="checkbox" name="group_id[]" title="{$v.title}" value="{$v.id}">
{/volist}
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block" style="max-width: 600px;">
<textarea name="desc" placeholder="请输入备注" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/admin/add')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,121 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-block">
<input type="text" autocomplete="off" placeholder="请输入用户名" class="layui-input" value="{$data.username}" disabled>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" placeholder="如果输入密码则会重置密码" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">确认密码</label>
<div class="layui-input-inline">
<input type="password" name="password_confirm" placeholder="请再次输入密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">昵称</label>
<div class="layui-input-inline">
<input type="text" name="nickname" lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input" value="{$data.nickname}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">头像</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传头像</button>
<div class="layui-upload-list" id="demo1">
<img src="{$data.thumb}" width="100" />
<input type="hidden" name="thumb" value="{$data.thumb}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">管理组</label>
<div class="layui-input-block">
{volist name="$group" id="v"}
<input type="checkbox" name="group_id[]" title="{$v.title}" value="{$v.id}" {in name="$v.id" value="$data.groups"}checked{/in}>
{/volist}
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block" style="max-width: 600px;">
<textarea name="desc" placeholder="请输入备注" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/admin/edit')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,94 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">昵称</label>
<div class="layui-input-inline">
<input type="text" name="nickname" lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input" value="{$admin.nickname}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">头像</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传头像</button>
<div class="layui-upload-list" id="demo1">
<img src="{$admin.thumb}" width="100" />
<input type="hidden" name="thumb" value="{$admin.thumb}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" placeholder="如果输入密码则会重置密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">确认密码</label>
<div class="layui-input-inline">
<input type="password" name="password_confirm" placeholder="请再次输入密码" autocomplete="off" class="layui-input">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/index/editAdminInfo')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
{include file="common/head"}
<form class="layui-form" style="display: inline;">
<input type="text" name="keywords" required lay-verify="required" placeholder="" class="layui-input" autocomplete="off" style="max-width: 200px;display: inline;margin: 10px 10px 0 0;height: 30px;" />
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit="" lay-filter="vaeform">立即搜索</button>
</form>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加管理员</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/admin/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'id', title: 'ID', sort: true, fixed: 'left', align:'center', width:80}
,{field: 'groupName', title: '管理组', align:'center'}
,{field: 'thumb', title:'头像', toolbar: '#thumb', align:'center', width:80}
,{field: 'username', title: '用户名', align:'center'}
,{field: 'nickname', title: '昵称', align:'center'}
,{field: 'last_login_time', title: '最后登录时间', sort: true, align:'center', sort: true}
,{field: 'last_login_ip', title: '最后登录IP', align:'center'}
,{field: 'status', title:'状态', toolbar: '#status', align:'center', width:100}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/admin/add')}",
title:"添加管理员",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/admin/delete')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/admin/edit')}?id="+data.id,
title:'修改管理员'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,101 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">父级</label>
<div class="layui-input-block">
<select name="pid" lay-verify="required" lay-search="">
<option value="0">顶级</option>
{volist name=":vae_set_recursion($cate)" id="v"}
<option value="{$v.id}">{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图标</button>
<div class="layui-upload-list" id="demo1">
<img src="" width="100" />
<input type="hidden" name="icon" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="0">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="cate_group_id" value="{$cate_group_id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/cate/addCate')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,83 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/cate/addGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,102 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.icon}}' height="20" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加分类</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/cate/cateIndex')}?cate_group_id={$cate_group_id}" //数据接口
,page: false //开启分页
,cols: [[ //表头
{field: 'sort', title: '排序', align:'center'}
,{field: 'title', title: '名称', align:'left'}
,{field: 'icon', title: '图标', align:'center', toolbar: '#thumb'}
,{field: 'status', title:'状态', align:'center', toolbar: '#status'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/cate/addCate',['cate_group_id'=>$cate_group_id])}",
title:"添加分类",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/cate/deleteCate')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/cate/editCate')}?id="+data.id,
title:'修改分类-'+data.title,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,108 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.title}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">父级</label>
<div class="layui-input-block">
<select name="pid" lay-verify="required" lay-search="">
<option value="0">顶级</option>
{volist name=":vae_set_recursion($cate)" id="v"}
<option value="{$v.id}" {eq name="$data.pid" value="$v.id"}selected=""{/eq}>{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图标</button>
<div class="layui-upload-list" id="demo1">
<img src="{$data.icon}" width="100" />
<input type="hidden" name="icon" value="{$data.icon}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.sort}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/cate/editCate')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,84 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.key}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/cate/editGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加分类组</button>
<span class="layui-badge-rim">提示:双击数据行可对分类组的数据进行增删改查</span>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/cate/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'name', title: '组名', align:'center'}
,{field: 'key', title: '标识', align:'center'}
,{field: 'desc', title:'备注', align:'center'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/cate/addGroup')}",
title:"添加分类组",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/cate/deleteGroup')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/cate/editGroup')}?id="+data.id,
title:'修改分类组'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听行双击事件
table.on('rowDouble(test)', function(obj){
vae.open({
href:"{:url('admin/cate/cateIndex')}?cate_group_id="+obj.data.id,
title:obj.data.name+'-分类集'
})
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,2 @@
<script src="__AVIEW__/lib/layui/layui.js" charset="utf-8"></script>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vaeThink</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="__AVIEW__/lib/layui/css/layui.css" media="all">
</head>
<body>

View File

@ -0,0 +1,196 @@
{include file="common/head"}
<div class="layui-tab" style="max-width: 1200px;margin: 0 auto;">
<ul class="layui-tab-title">
<li class="layui-this">网站配置</li>
<li>邮件配置</li>
<li>短信配置</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入网站标题" class="layui-input" value="{$webConf.title}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">关键词</label>
<div class="layui-input-block">
<input type="text" name="keywords" autocomplete="off" placeholder="多个关键词用“,”隔开" class="layui-input" value="{$webConf.keywords}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">描述</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="请输入网站描述" class="layui-textarea">{$webConf.desc}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">LOGO</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传LOGO</button>
<div class="layui-upload-list" id="demo1">
<img src="{$webConf.logo}" />
<input type="hidden" name="logo" value="{$webConf.logo}">
</div>
</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">ICP备案号</label>
<div class="layui-input-block">
<input type="text" name="icp" autocomplete="off" placeholder="请输入ICP备案号" class="layui-input" value="{$webConf.icp}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">统计代码</label>
<div class="layui-input-block">
<textarea name="code" placeholder="请输入完整的统计代码" class="layui-textarea">{$webConf.code}</textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="type" value="web" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">SMTP</label>
<div class="layui-input-block">
<input type="text" name="smtp" lay-verify="required" autocomplete="off" placeholder="请输入SMTP服务器地址" class="layui-input" value="{$emailConf.smtp}">
<div class="layui-form-mid layui-word-aux">如qq邮箱的SMTP服务器地址是smtp.qq.com</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">账户</label>
<div class="layui-input-block">
<input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="请输入邮箱用户名" class="layui-input" value="{$emailConf.username}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-block">
<input type="password" name="password" lay-verify="required" autocomplete="off" placeholder="请输入邮箱密码" class="layui-input" value="{$emailConf.password}">
<div class="layui-form-mid layui-word-aux">不一定是登录密码,如qq的第三方授权登录码,要自己去开启,在邮箱的设置->账户->POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">端口</label>
<div class="layui-input-block">
<input type="text" name="port" lay-verify="required" autocomplete="off" placeholder="请输入端口" class="layui-input" value="{$emailConf.port}">
<div class="layui-form-mid layui-word-aux">如qq邮箱的ssl协议方式端口号是465/587</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱</label>
<div class="layui-input-block">
<input type="text" name="email" lay-verify="required" autocomplete="off" placeholder="请输入要显示的发送者邮箱" class="layui-input" value="{$emailConf.email}">
<div class="layui-form-mid layui-word-aux">可以不同于上面的账户,用于显示发送方的邮箱</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发送者</label>
<div class="layui-input-block">
<input type="text" name="from" lay-verify="required" autocomplete="off" placeholder="请输入要显示的发送者" class="layui-input" value="{$emailConf.from}">
<div class="layui-form-mid layui-word-aux">vaeThink</div>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="type" value="email" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">APPKEY</label>
<div class="layui-input-block">
<input type="text" name="appkey" lay-verify="required" autocomplete="off" placeholder="请输入阿里大鱼的appkey" class="layui-input" value="{$dayuConf.appkey}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">SECRETKEY</label>
<div class="layui-input-block">
<input type="text" name="secretkey" lay-verify="required" autocomplete="off" placeholder="请输入阿里大鱼的secretey" class="layui-input" value="{$dayuConf.secretkey}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">签名</label>
<div class="layui-input-block">
<input type="text" name="FreeSignName" lay-verify="required" autocomplete="off" placeholder="请输入有效的阿里大鱼的签名" class="layui-input" value="{$dayuConf.FreeSignName}">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="type" value="dayu" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae','element'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae
,element = layui.element;
//logo上传
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,done: function(res){
//如果上传失败
if(res.code == 0){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/conf/confSubmit')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,120 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" autocomplete="off" placeholder="" class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">概要</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类</label>
<div class="layui-input-block">
<select name="cate_id" lay-verify="required" lay-search="">
{volist name=":vae_set_recursion($cate)" id="v"}
<option value="{$v.id}">{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图片</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图片</button>
<div class="layui-upload-list" id="demo1">
<img src="" width="100" />
<input type="hidden" name="img" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="0">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">详情</label>
<div class="layui-input-block">
<textarea name="content" placeholder="" class="layui-textarea" id="container" style="border:0;padding:0"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="content_group_id" value="{$content_group_id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/content/addContent')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
<script id="container" name="content" type="text/plain"></script>
<script type="text/javascript" src="__AVIEW__/lib/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__AVIEW__/lib/ueditor/ueditor.all.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight:200,
});
</script>
</body>
</html>

View File

@ -0,0 +1,93 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类组</label>
<div class="layui-input-block">
<select name="cate_group_id" lay-verify="required" lay-search="">
{volist name="$cate_group" id="v"}
<option value="{$v.id}">{$v.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/content/addGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,103 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.img}}' height="20"/>
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加内容</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/content/contentIndex')}?content_group_id={$content_group_id}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'sort', title: '排序', align:'center'}
,{field: 'title', title: '标题', align:'center'}
,{field: 'img', title: '图片', align:'center', toolbar: '#thumb'}
,{field: 'cate_name', title: '分类', align:'center'}
,{field: 'status', title:'状态', align:'center', toolbar: '#status'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/content/addContent',['content_group_id'=>$content_group_id])}",
title:"添加内容",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/content/deleteContent')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/content/editContent')}?id="+data.id,
title:'修改内容-'+data.title,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,127 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" autocomplete="off" placeholder="" class="layui-input" lay-verify="required" value="{$data.title}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">概要</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类</label>
<div class="layui-input-block">
<select name="cate_id" lay-verify="required" lay-search="">
{volist name=":vae_set_recursion($cate)" id="v"}
<option value="{$v.id}" {eq name="$data.cate_id" value="$v.id"}selected=""{/eq}>{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图片</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图片</button>
<div class="layui-upload-list" id="demo1">
<img src="{$data.img}" width="100" />
<input type="hidden" name="img" value="{$data.img}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.sort}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">详情</label>
<div class="layui-input-block">
<textarea name="content" placeholder="" class="layui-textarea" id="container" style="border:0;padding:0">{$data.content}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/content/editContent')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
<script id="container" name="content" type="text/plain"></script>
<script type="text/javascript" src="__AVIEW__/lib/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__AVIEW__/lib/ueditor/ueditor.all.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('container',{
//初始化高度
initialFrameHeight:200,
});
</script>
</body>
</html>

View File

@ -0,0 +1,94 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.key}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类组</label>
<div class="layui-input-block">
<select name="cate_group_id" lay-verify="required" lay-search="">
{volist name="$cate_group" id="v"}
<option value="{$v.id}" {eq name="$data.cate_group_id" value="$v.id"}selected=""{/eq}>{$v.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/content/editGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加内容组</button>
<span class="layui-badge-rim">提示:双击数据行可对内容组的数据进行增删改查</span>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/content/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'name', title: '组名', align:'center'}
,{field: 'key', title: '标识', align:'center'}
,{field: 'desc', title:'备注', align:'center'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/content/addGroup')}",
title:"添加内容组",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/content/deleteGroup')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/content/editGroup')}?id="+data.id,
title:'修改内容组'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听行双击事件
table.on('rowDouble(test)', function(obj){
vae.open({
href:"{:url('admin/content/contentIndex')}?content_group_id="+obj.data.id,
title:obj.data.name+'-内容集'
})
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,101 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="title" lay-verify="required" placeholder="请输入名称" autocomplete="off" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">菜单</label>
<div class="layui-input-block">
<div id="test12" class="demo-tree-more"></div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="请输入备注" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" type="submit" lay-submit lay-filter="vaeform">提交</button>
<button class="layui-btn layui-btn-primary" type="reset">重置</button>
</div>
</div>
</form>
</body>
{include file="common/foot"}
<script type="text/javascript">
layui.config({
base: '__AVIEW__/module/',
}).use(['form', 'vae', 'tree'], function(){
var $ = layui.$;
var form = layui.form;
var vae = layui.vae;
var tree = layui.tree;
let data;
vae.ajax({
url:"{:url('admin/index/getRuleList')}",
async:false,
success:function(res){
if(res.code == 200){
data = res.data;
}else{
layer.msg(res.msg);
return false;
}
}
})
//基本演示
tree.render({
elem: '#test12'
,data: data
,id: 'demoId1'
,onlyIconControl: false
,showCheckbox: true
});
//监听提交
form.on('submit(vaeform)', function(obj){
//获得选中的节点
var ids = [];
var finds = function(arr){
arr.forEach((item) => { //利用foreach循环遍历
ids.push(item.id);
// console.log('333'+item.children);
if(item.children&&item.children.length > 0) //判断chlidren是否有数据
{
finds(item.children); //递归调用
}
})
}
finds(tree.getChecked('demoId1'));
obj.field.rules = ids;
vae.ajax({
url: "{:url('admin/group/add')}",
data: obj.field,
type: 'post',
success: function(res){
layer.msg(res.msg);
if(res.code==200){
vae.close();
}
}
});
return false;
});
});
</script>
</html>

View File

@ -0,0 +1,111 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="title" lay-verify="required" placeholder="请输入名称" autocomplete="off" value="{$group.title}" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">菜单</label>
<div class="layui-input-block">
<div id="test12" class="demo-tree-more"></div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="请输入备注" class="layui-textarea">{$group.desc}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$group.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$group.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$group.id}" />
<button class="layui-btn layui-btn-primary" type="submit" lay-submit lay-filter="vaeform">提交</button>
<button class="layui-btn layui-btn-primary" type="reset">重置</button>
</div>
</div>
</form>
</body>
{include file="common/foot"}
<script type="text/javascript">
layui.config({
base: '__AVIEW__/module/',
}).use(['form', 'vae', 'tree'], function(){
var $ = layui.$;
var form = layui.form;
var vae = layui.vae;
var tree = layui.tree;
let data;
vae.ajax({
url:"{:url('admin/index/getRuleList')}",
async:false,
success:function(res){
if(res.code == 200){
data = res.data;
}else{
layer.msg(res.msg);
return false;
}
}
})
//基本演示
tree.render({
elem: '#test12'
,data: data
,id: 'demoId1'
,onlyIconControl: false
,showCheckbox: true
});
"{volist name='$group.rules' id='vo'}"
tree.setChecked('demoId1', {$vo});
"{/volist}"
//监听提交
form.on('submit(vaeform)', function(obj){
//获得选中的节点
var ids = [];
var finds = function(arr){
arr.forEach((item) => { //利用foreach循环遍历
ids.push(item.id);
// console.log('333'+item.children);
if(item.children&&item.children.length > 0) //判断chlidren是否有数据
{
finds(item.children); //递归调用
}
})
}
finds(tree.getChecked('demoId1'));
obj.field.rules = ids;
vae.ajax({
url: "{:url('admin/group/edit')}",
data: obj.field,
type: 'post',
success: function(res){
layer.msg(res.msg);
if(res.code==200){
vae.close();
}
}
});
return false;
});
});
</script>
</html>

View File

@ -0,0 +1,108 @@
{include file="common/head"}
<form class="layui-form" style="display: inline;">
<input type="text" name="keywords" required lay-verify="required" placeholder="" class="layui-input" autocomplete="off" style="max-width: 200px;display: inline;margin: 10px 10px 0 0;height: 30px;" />
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit="" lay-filter="vaeform">立即搜索</button>
</form>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="25" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加管理组</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/group/index')}" //数据接口
,page: true //开启分页
,limit: 15
,cols: [[ //表头
{field: 'id', title: 'ID', sort: true, fixed: 'left', align:'center', width:80}
,{field: 'title', title: '名称', align:'center'}
,{field: 'desc', title:'备注', align:'center'}
,{field: 'status', title:'状态', toolbar: '#status', align:'center', width:100}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/group/add')}",
title:"添加管理组",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/group/delete')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/group/edit')}?id="+data.id,
title:'修改管理组'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,255 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vaeThink</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="__AVIEW__/lib/layui/css/layui.css" media="all">
<style type="text/css">
html,body {
width:100%;
overflow: hidden;
}
*{
padding: 0;
margin: 0;
}
.vaeyo-main-header{
height: 300px;
}
.console-md{
/*background-color: #009688;*/
height:100px;
/*border:1px solid #f2f2f2;*/
}
.borders{
border:1px solid #f0f0f0;
}
.layui-table, .layui-table-view{
margin: 0;
}
</style>
</head>
<body>
<div>
<div class="layui-row layui-col-space15">
<div class="layui-col-md3 layui-anim layui-anim-scale">
<div class="console-md borders">
</div>
</div>
<div class="layui-col-md3 layui-anim layui-anim-scale">
<div class="console-md borders">
</div>
</div>
<div class="layui-col-md3 layui-anim layui-anim-scale">
<div class="console-md borders">
</div>
</div>
<div class="layui-col-md3 layui-anim layui-anim-scale">
<div class="console-md borders">
</div>
</div>
<div class="layui-col-md8 layui-anim layui-anim-scale">
<div class="console-md borders" style="height: 298px;">
<div class="vaeyo-main-header" id="vaeyo-main-header"></div>
</div>
</div>
<div class="layui-col-md4 layui-anim layui-anim-scale">
<div class="console-md borders" style="height: 300px;">
<!-- <div class="layui-carousel" id="test2">
<div carousel-item="">
<div class="layui-bg-green"></div>
<div class="layui-bg-blue"></div>
</div>
</div> -->
</div>
</div>
<div class="layui-col-md4 layui-anim layui-anim-scale">
<div class="console-md" style="height: 300px;">
<div class="layui-progress">
<div class="layui-progress-bar layui-bg-red" lay-percent="20%"></div>
</div>
<br>
<div class="layui-progress">
<div class="layui-progress-bar layui-bg-orange" lay-percent="30%"></div>
</div>
<br>
<div class="layui-progress">
<div class="layui-progress-bar layui-bg-green" lay-percent="40%"></div>
</div>
<br>
<div class="layui-progress">
<div class="layui-progress-bar layui-bg-blue" lay-percent="50%"></div>
</div>
<br>
<div class="layui-progress">
<div class="layui-progress-bar layui-bg-cyan" lay-percent="60%"></div>
</div>
<br>
<div class="layui-progress layui-progress-big">
<div class="layui-progress-bar" lay-percent="20%"></div>
</div>
<br>
<div class="layui-progress layui-progress-big">
<div class="layui-progress-bar layui-bg-green" lay-percent="35%"></div>
</div>
<br>
<div class="layui-progress layui-progress-big">
<div class="layui-progress-bar layui-bg-cyan" lay-percent="75%"></div>
</div>
<br>
<br>
<div class="layui-progress" lay-showpercent="true">
<div class="layui-progress-bar" lay-percent="20%"></div>
</div>
<br>
<div class="layui-progress" lay-showpercent="true">
<div class="layui-progress-bar" lay-percent="5 / 10"></div>
</div>
<br>
<div class="layui-progress layui-progress-big" lay-showpercent="true">
<div class="layui-progress-bar" lay-percent="70%"></div>
</div>
</div>
</div>
<div class="layui-col-md8 layui-anim layui-anim-scale">
<div class="console-md" style="height: 300px;padding-top: -15px">
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
</div>
</div>
</div>
</div>
<script src="__AVIEW__/lib/layui/layui.js" charset="utf-8"></script>
<script>
layui.config({
base: '__AVIEW__/module/'
}).define(['table','echarts','layer','element','carousel'], function(exports){
var $ = layui.jquery,layer = layui.layer,element = layui.element,table = layui.table,carousel = layui.carousel;
var myChart = echarts.init(document.getElementById('vaeyo-main-header'));
var pv = [];
var uv = [];
for (var i = 23; i >= 0; i--) {
pv[i] = Math.floor(Math.random()*i*50);
uv[i] = Math.floor(Math.random()*i*100);
}
var data = {
"time":['00:00','01:00','02:00','03:00','04:00','05:00','06:00','07:00','08:00','09:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00','19:00','20:00','21:00','22:00','23:00'],
"pv":pv,
"uv":uv
}
option = {
tooltip : {
trigger: 'axis'
},
legend: {
data:['','']
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['UV','PV']
},
grid: {
top:'10%',
left: '1%',
right: '2%',
bottom: '5%',
containLabel: true
},
xAxis : [{
type : 'category',
boundaryGap : false,
data: data.time
}],
yAxis : [{
type : 'value',
splitLine: {show: false}
}],
series : [{
name:'UV',
type:'line',
smooth: true,
itemStyle: {normal: {color:'#009688'}},
lineStyle:{normal:{color:'#009688',width:1}},
areaStyle: {normal:{color:'#009688'}},
data: data.uv
},{
name:'PV',
type:'line',
smooth: true,
itemStyle: {normal: {color:'#01AAED'}},
lineStyle:{normal:{color:'#01AAED',width:1}},
areaStyle: {normal:{color:'#01AAED'}},
data: data.pv
}]
};
myChart.setOption(option);
$(window).on('resize', function () {
myChart.resize();
});
var tableIns = table.render({
elem: '#test'
,url: "{:url('admin/admin/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'id', title: 'ID', sort: true, fixed: 'left', align:'center', width:80}
,{field: 'groupName', title: '管理组', align:'center'}
,{field: 'thumb', title:'头像', toolbar: '#thumb', align:'center', width:80}
,{field: 'username', title: '用户名', align:'center'}
,{field: 'nickname', title: '昵称', align:'center'}
,{field: 'last_login_time', title: '最后登录时间', sort: true, align:'center', sort: true}
,{field: 'last_login_ip', title: '最后登录IP', align:'center'}
,{field: 'status', title:'状态', toolbar: '#status', align:'center', width:100}
]]
,size: "sm"
});
carousel.render({
elem: '#test2'
,interval: 1800
,anim: 'fade'
,height: '300px'
});
exports('main', {});
});
</script>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>异常</title>
<link rel="stylesheet" href="__AVIEW__/lib/layui/css/layui.css" media="all">
<style type="text/css">
html,body{
height:100%;
width: 100%;
}
.error-body{
height:100%;
text-align: center;
line-height: 30;
font-size:16px;
}
.error-body i{
font-size:20px;
color:red;
}
</style>
</head>
<body>
<div class="error-body">
<i class="layui-icon layui-icon-tips"></i>
{$msg}
</div>
</body>
</html>

View File

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vaeThink-超好用的PHP(ThinkPHP6,Layui)内容管理框架</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="__AVIEW__/css/admin.css">
<link rel="stylesheet" href="__AVIEW__/css/theme.css">
</head>
<body class="layui-layout-body">
<!-- 更换主体 Eg:orange_theme|blue_theme -->
<div class="layui-layout layui-layout-admin vadmin blue_theme">
<!--头部导航-->
<div class="layui-header vadmin-header">
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item">
<a class="v-menu v-show-menu" href="javascript:" title="菜单切换">
<i class="layui-icon layui-icon-shrink-right"></i>
</a>
</li>
<li class="layui-nav-item">
<a class="" href="javascript:" title="清空缓存" id="vae-del-cache">
<i class="layui-icon layui-icon-fonts-clear"></i>
</a>
</li>
<li class="layui-nav-item">
<a class="" href="/" title="前台首页" target="_blank">
<i class="layui-icon layui-icon-website" style="font-size: 18px;"></i>
</a>
</li>
<!--天气信息-->
<!--
<li class="v-nav-item v-hide-md">
<div class="weather-v">
<iframe frameborder="0" scrolling="no" class="iframe-style" src="pages/weather.html" frameborder="0"></iframe>
</div>
</li>
-->
</ul>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item v-input-search">
<input type="text" placeholder="搜索..." class="layui-input layui-input-search"/>
</li>
<li class="layui-nav-item">
<a class="v-refresh" href="javascript:" title="刷新">
<i class="layui-icon layui-icon-refresh-3"></i>
</a>
</li>
<!-- 全屏 -->
<li class="layui-nav-item layui-hide-xs">
<a id="fullScreen" class=" pr10 pl10" href="javascript:">
<i class="layui-icon layui-icon-screen-full"></i>
</a>
</li>
<!-- 便签 -->
<li class="no-line layui-nav-item layui-hide-xs">
<a id="note" class="flex-vc pr10 pl10" href="javascript:">
<i class="layui-icon layui-icon-note"></i>
</a>
</li>
<li class="no-line layui-nav-item layui-hide-xs">
<a id="lock" class="flex-vc pr10 pl10" href="javascript:">
<i class="v-icon v-icon-lock icon-head-i" title="锁屏"></i><cite></cite>
</a>
</li>
<!-- 退出 -->
<li class="layui-nav-item layui-hide-xs">
<a id="logout" class=" pr10 pl10" href="javascript:">
<i class="layui-icon layui-icon-logout" style="color:#FF5722;font-weight: bold;"></i>
</a>
</li>
<!-- 皮肤 -->
<li class="layui-nav-item layui-hide-xs">
<a id="vae-color" class=" pr10 pl10" href="javascript:">
<i class="layui-icon layui-icon-theme"></i>
</a>
</li>
</ul>
</div>
<!--遮罩层-->
<div class="v-make"></div>
<!--左侧导航区域-->
<div class="layui-side layui-side-menu vadmin-bg-20222A v-left">
<div class="vadmin-side"><!--
<div class="vadmin-logo">v-admin v2.0</div> -->
<div class="user-photo">
<a class="img" title="点击修改资料" id="thumb" href="javascript:;">
<img src="{$uInfo.thumb}" class="userAvatar">
</a>
<p>欢迎,<span class="userName">{$uInfo.nickname}</span></p>
</div>
<!--左侧导航菜单-->
<ul id="navBar" class="layui-nav vadmin-nav vadmin-bg-20222A layui-nav-tree">
<!-- <li class="layui-nav-item layui-this">
<a href="javascript:" lay-id="1" data-url="pages/console.html">
<i is-close=false class="v-icon">&#xe654;</i>
<i class="layui-icon layui-icon-chart"></i>
控制台
</a>
</li> -->
</ul>
</div>
</div>
<!-- 内容主体区域 -->
<div class="content-body">
<div class="layui-tab v-tab" lay-filter="v-tab" lay-allowClose="true" lay-unauto>
<div data-id="left" id="vLeftMove"
class="v-icon v-icon-back vadmin-tabs-control move-left vNavMove"></div>
<div data-id="right" id="vRightMove"
class="v-icon v-icon-right vadmin-tabs-control move-right vNavMove"></div>
<div class="layui-icon vadmin-tabs-control v-right-nav-menu" style="right: 0;">
<ul class="vadmin-tab">
<li class="no-line vadmin-tab-item">
<div class="vadmin-link layui-icon-down" href="javascript:;"></div>
<dl id="tabAction" class="vadmin-tab-child layui-anim-upbit layui-anim">
<dd><a data-num="1" href="javascript:">关闭当前标签页</a></dd>
<dd><a data-num="2" href="javascript:">关闭其他标签页</a></dd>
<dd><a data-num="3" href="javascript:">关闭所有标签页</a></dd>
</dl>
</li>
</ul>
</div>
<ul id="tabTitle" class="layui-tab-title v-tab-title not-scroll">
<li class="layui-this" lay-id="1" tab="index">
<!-- <i class="v-icon">&#xe654;</i> -->
<i class="layui-icon layui-icon-home"></i>
<cite is-close=false>首页</cite>
</li>
</ul>
<div id="tabContent" class="layui-tab-content v-tab-content">
<div class="layui-tab-item layui-show">
<iframe src="{:url('admin/index/console')}" frameborder="0" scrolling="yes" width="100%"
height="100%"></iframe>
</div>
</div>
</div>
</div>
</div>
<div class="yy"></div>
<!--js逻辑-->
<script src="__AVIEW__/lib/layui/layui.js"></script>
<script src="__AVIEW__/js/admin.js"></script>
</body>
</html>

View File

@ -0,0 +1,80 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">父级</label>
<div class="layui-input-block">
<select name="pid" lay-verify="required" lay-search="">
<option value="0">顶级菜单</option>
{volist name=":vae_set_recursion($menu)" id="v"}
<option value="{$v.id}">{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入名称" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
<div class="layui-input-block">
<input type="text" name="src" placeholder="请输入链接" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<input type="checkbox" name="is_menu" lay-skin="switch" value="1" lay-text="权限+菜单|仅权限">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-block">
<input type="text" name="icon" placeholder="仅在开启左侧菜单状态下有效,目前仅支持layui内置图标" autocomplete="off" class="layui-input">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,vae = layui.vae;
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/menu/add')}",
headers:{'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
type:'post',
data:data.field,
success:function(res){
layer.msg(res.msg);
if(res.code == 200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,82 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">父级</label>
<div class="layui-input-block">
<select name="pid" lay-verify="required" lay-search="">
<option value="0">顶级菜单</option>
{volist name=":vae_set_recursion($menu)" id="v"}
<option value="{$v.id}" {eq name="$data.pid" value="$v.id"}selected=""{/eq}>{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入名称" class="layui-input" value="{$data.title}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
<div class="layui-input-block">
<input type="text" name="src" placeholder="请输入链接" autocomplete="off" class="layui-input" value="{$data.src}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<input type="checkbox" name="is_menu" lay-skin="switch" value="1" lay-text="权限+菜单|仅权限" {eq name="$data.is_menu" value="1"}checked{/eq}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-block">
<input type="text" name="icon" placeholder="仅在开启左侧菜单状态下有效,目前仅支持layui内置图标" autocomplete="off" class="layui-input" value="{$data.icon}">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,vae = layui.vae;
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/menu/edit')}",
headers:{'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
type:'post',
data:data.field,
success:function(res){
console.log(res);
layer.msg(res.msg);
if(res.code == 200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,101 @@
{include file="common/head"}
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" lay-demo="add">添加菜单</button>
</div>
<div id="test12" class="demo-tree-more"></div>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['tree', 'util', 'vae'], function(){
var tree = layui.tree
,layer = layui.layer
,util = layui.util
,$ = layui.$
,vae = layui.vae;
let data;
vae.ajax({
url:"{:url('admin/menu/index')}",
async:false,
success:function(res){
if(res.code == 200){
data = res.data;
}else{
layer.msg(res.msg);
return false;
}
}
})
//基本演示
tree.render({
elem: '#test12'
,data: data
,edit: ['del']
,id: 'demoId1'
,onlyIconControl: true
,click: function(obj){
//修改
var data = obj.data; //获取当前点击的节点数据
vae.open({
href: "{:url('admin/menu/edit')}?id="+data.id,
title: '修改菜单'+data.id,
end: function(res) {
tree.reload('demoId1', {
});
}
});
}
,operate: function(obj){
var type = obj.type; //得到操作类型add、edit、del
var data = obj.data; //得到当前节点的数据
var elem = obj.elem; //得到当前节点元素
//Ajax 操作
var id = data.id; //得到节点索引
if(type === 'del'){ //删除节点
vae.ajax({
url:"{:url('admin/menu/delete')}",
data:{id:id},
success:function(res){
layer.msg(res.msg);
if(res.code !== 200) {
return false;
}
}
})
return false;
}
}
});
//按钮事件
util.event('lay-demo', {
add: function(){
vae.open({
href: "{:url('admin/menu/add')}",
title: '添加菜单',
end: function(res) {
tree.reload('demoId1', {
});
}
});
}
,reload: function(){
//重载实例
tree.reload('demoId1', {
});
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,83 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/nav/addGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,96 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转</label>
<div class="layui-input-block">
<input type="text" name="src" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图标</button>
<div class="layui-upload-list" id="demo1">
<img src="" width="100" />
<input type="hidden" name="icon" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="0">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="nav_group_id" value="{$nav_group_id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/nav/addNav')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,84 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.key}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/nav/editGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,103 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.title}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转</label>
<div class="layui-input-block">
<input type="text" name="src" autocomplete="off" placeholder="" class="layui-input" value="{$data.src}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图标</button>
<div class="layui-upload-list" id="demo1">
<img src="{$data.icon}" width="100" />
<input type="hidden" name="icon" value="{$data.icon}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.sort}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/nav/editNav')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加导航组</button>
<span class="layui-badge-rim">提示:双击数据行可对导航组的数据进行增删改查</span>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/nav/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'name', title: '组名', align:'center'}
,{field: 'key', title: '标识', align:'center'}
,{field: 'desc', title:'备注', align:'center'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/nav/addGroup')}",
title:"添加导航组",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/nav/deleteGroup')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/nav/editGroup')}?id="+data.id,
title:'修改导航组'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听行双击事件
table.on('rowDouble(test)', function(obj){
vae.open({
href:"{:url('admin/nav/navIndex')}?nav_group_id="+obj.data.id,
title:obj.data.name+'-导航集'
})
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,103 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.icon}}' height="20" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加导航</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/nav/navIndex')}?nav_group_id={$nav_group_id}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'sort', title: '排序', align:'center'}
,{field: 'title', title: '名称', align:'center'}
,{field: 'icon', title: '图标', align:'center', toolbar: '#thumb'}
,{field: 'src', title: '跳转', align:'center'}
,{field: 'status', title:'状态', align:'center', toolbar: '#status'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/nav/addNav',['nav_group_id'=>$nav_group_id])}",
title:"添加导航",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/nav/deleteNav')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/nav/editNav')}?id="+data.id,
title:'修改导航-'+data.title,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<link rel="stylesheet" href="__AVIEW__/lib/layui/css/layui.css" media="all">
<style type="text/css">
/*body{
background:url('/themes/admin_themes/lib/vaeyo/img/bg.jpg');
}*/
.vaeyo-login-body{
min-width:300px;
max-width:400px;
min-height:150px;
margin:0 auto;
margin-top:200px
}
.vaeyo-login-body h2{
margin: 20px auto;
text-align: center;
font-size: 32px;
}
</style>
</head>
<body>
<div class="vaeyo-login-body">
<!-- <h2>登录</h2> -->
<form class="layui-form" id="vaeyo-login">
<div class="layui-form-item">
<input type="text" name="username" lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-item">
<input type="password" name="password" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-item">
<div id="slider"></div>
{:token_meta()}
</div>
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="vaeyo-login-submit" id="vaeyo-login-submit">立即登录</button>
</form>
</div>
<script src="__AVIEW__/lib/layui/layui.js"></script>
<script type="text/javascript">
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae',"sliderVerify"], function () {
var form = layui.form,$ = layui.$,vae = layui.vae,sliderVerify = layui.sliderVerify;
var slider = sliderVerify.render({
elem: '#slider',
// bg : 'layui-bg-red',//自定义背景样式名
// text : '滑动',
// onOk: function(){
// layer.msg("滑块验证通过");
// }
})
form.on('submit(vaeyo-login-submit)', function(data) {
if(slider.isOk())
{
vae.ajax({
url:"{:url('/admin/publicer/adminLoginSubmit')}",
type:'post',
data:$('#vaeyo-login').serialize(),
success:function(res) {
layer.tips(res.msg,'#vaeyo-login-submit');
if(res.code === 200) {
setTimeout(function() {
location.href = "{:url('admin/index/index')}";
}, 1500);
} else {
slider.reset();
}
}
})
}
else
{
layer.msg("请先通过滑块验证");
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,63 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">应用(模块)</label>
<div class="layui-input-block">
<input type="text" name="module" lay-verify="required" autocomplete="off" placeholder="请输入应用名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">原始链接</label>
<div class="layui-input-block">
<input type="text" name="full_url" lay-verify="required" autocomplete="off" placeholder="请输入完整的原始链接" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">美化后</label>
<div class="layui-input-block">
<input type="text" name="url" lay-verify="required" placeholder="请输入美化后想要显示的链接" autocomplete="off" class="layui-input">
<div class="layui-form-mid layui-word-aux">url格式一般为name/:参数1/:参数2</div>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,vae = layui.vae;
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/route/add')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,71 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">应用(模块)</label>
<div class="layui-input-block">
<input type="text" name="module" lay-verify="required" autocomplete="off" placeholder="请输入应用名" class="layui-input" value="{$data.module}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">原始链接</label>
<div class="layui-input-block">
<input type="text" name="full_url" lay-verify="required" autocomplete="off" placeholder="请输入完整的原始链接" class="layui-input" value="{$data.full_url}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">美化后</label>
<div class="layui-input-block">
<input type="text" name="url" lay-verify="required" placeholder="请输入美化后想要显示的链接" autocomplete="off" class="layui-input" value="{$data.url}">
<div class="layui-form-mid layui-word-aux">url格式一般为name/:参数1/:参数2</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="启用" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,vae = layui.vae;
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/route/edit')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,114 @@
{include file="common/head"}
<form class="layui-form" style="display: inline;">
<input type="text" name="keywords" required lay-verify="required" placeholder="" class="layui-input" autocomplete="off" style="max-width: 200px;display: inline;margin: 10px 10px 0 0;height: 30px;" />
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit="" lay-filter="vaeform">立即搜索</button>
</form>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="href">
<a href="/index.php/{{d.module}}/{{d.url}}" target="_blank" style="color:#01AAED;">/{{d.module}}/{{d.url}}</a>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加路由</button>
<span class="layui-badge-rim">注意:如果应用(模块)单独绑定了域名,在访问设置后的链接时无需加应用名</span>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,title: '用户数据表'
,url: "{:url('admin/route/index')}" //数据接口
,page: true //开启分页
,limit: 15
,cols: [[ //表头
{field: 'id', title: 'ID', sort: true, fixed: 'left', align:'center', width:80}
,{field: 'module', title: '应用(模块)', align:'center'}
,{field: 'full_url', title: '原始链接', align:'center'}
,{field: 'url', title:'路由', align:'center',}
,{field: '', title:'访问地址:应用(模块)名+路由', align:'center',toolbar: '#href'}
,{field: 'status', title:'状态', toolbar: '#status', align:'center', width:100}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/route/add')}",
title:"添加路由",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/route/delete')}",
data:{id:data.id,module:data.module},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/route/edit')}?id="+data.id,
title:'修改路由'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
console.log(data.field.keywords)
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords}});
vae.bundledTab();
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,83 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea"></textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/slide/addGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,89 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">图片</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图片</button>
<div class="layui-upload-list" id="demo1">
<img src="" width="100" />
<input type="hidden" name="icon" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转</label>
<div class="layui-input-block">
<input type="text" name="src" autocomplete="off" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="0">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="slide_group_id" value="{$slide_group_id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/slide/addSlide')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,84 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">组名</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.name}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input type="text" name="key" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.key}">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<textarea name="desc" placeholder="" class="layui-textarea">{$data.desc}</textarea>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/slide/editGroup')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,96 @@
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">图片</label>
<div class="layui-input-inline">
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-primary" id="test1">上传图片</button>
<div class="layui-upload-list" id="demo1">
<img src="{$data.icon}" width="100" />
<input type="hidden" name="icon" value="{$data.icon}">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跳转</label>
<div class="layui-input-block">
<input type="text" name="src" autocomplete="off" placeholder="" class="layui-input" value="{$data.src}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$data.sort}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="正常" {eq name="$data.status" value="1"}checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$data.status" value="0"}checked{/eq}>
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<input type="hidden" name="id" value="{$data.id}" />
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['upload','form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,upload = layui.upload
,vae = layui.vae;
//头像上传
let load;
var uploadInst = upload.render({
elem: '#test1'
,url: "{:url('admin/index/upload')}"
,choose: function(res) {
load = layer.load(1);
}
,done: function(res){
layer.close(load);
//如果上传失败
if(res.code == 202){
return layer.msg('上传失败');
}
//上传成功
$('#demo1 input').attr('value',res.data);
$('#demo1 img').attr('src',res.data);
}
});
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/slide/editSlide')}",
type:'post',
data:data.field,
success:function(e){
layer.msg(e.msg);
if(e.code==200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.thumb}}' height="20" style="border-radius: 50%;" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加轮播组</button>
<span class="layui-badge-rim">提示:双击数据行可对轮播组的数据进行增删改查</span>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/slide/index')}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'name', title: '组名', align:'center'}
,{field: 'key', title: '标识', align:'center'}
,{field: 'desc', title:'备注', align:'center'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/slide/addGroup')}",
title:"添加导航组",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/slide/deleteGroup')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/slide/editGroup')}?id="+data.id,
title:'修改导航组'+data.id,
end:function(){
tableIns.reload();
}
})
}
});
//监听行双击事件
table.on('rowDouble(test)', function(obj){
vae.open({
href:"{:url('admin/slide/slideIndex')}?slide_group_id="+obj.data.id,
title:obj.data.name+'-导航集'
})
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,102 @@
{include file="common/head"}
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="thumb">
<img src='{{d.icon}}' height="20" />
</script>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add">添加轮播图</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-icon layui-icon-edit" lay-event="edit" href="javascript:;"></a>
<a class="layui-icon layui-icon-delete" lay-event="del" href="javascript:;"></a>
</script>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['table','vae','form'], function(){
var table = layui.table
,vae = layui.vae
,$ = layui.$
,form = layui.form;
var tableIns = table.render({
elem: '#test'
,toolbar: '#toolbarDemo'
,url: "{:url('admin/slide/slideIndex')}?slide_group_id={$slide_group_id}" //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'sort', title: '排序', align:'center'}
,{field: 'icon', title: '图片', align:'center', toolbar: '#thumb'}
,{field: 'src', title: '跳转', align:'center'}
,{field: 'status', title:'状态', align:'center', toolbar: '#status'}
,{field: 'right', toolbar: '#barDemo', width:150, align:'center'}
]]
,size: "sm"
});
//监听事件
table.on('toolbar(test)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'add':
vae.open({
href:"{:url('admin/slide/addSlide',['slide_group_id'=>$slide_group_id])}",
title:"添加轮播图",
end:function(){
tableIns.reload();
}
})
break;
};
});
//监听行工具事件
table.on('tool(test)', function(obj){
var data = obj.data;
if(obj.event === 'del'){
vae.confirm('真的删除么', function(index){
$.ajax({
url:"{:url('/admin/slide/deleteSlide')}",
data:{id:data.id},
success:function(res){
layer.msg(res.msg);
if(res.code==200){
obj.del();
}
}
})
layer.close(index);
});
}else if(obj.event === 'edit'){
vae.open({
href:"{:url('admin/slide/editSlide')}?id="+data.id,
title:'修改轮播图-'+data.title,
end:function(){
tableIns.reload();
}
})
}
});
//监听搜索提交
form.on('submit(vaeform)', function(data){
if(data.field.keywords) {
tableIns.reload({where:{keywords:data.field.keywords,page:1}});
}
return false;
});
});
</script>
</body>
</html>

220
app/common.php Normal file
View File

@ -0,0 +1,220 @@
<?php
// 应用公共文件
use think\facade\Config;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
/**
* 返回json数据用于接口
* @Author 听雨
* @DateTime 2020-03-31
* @param integer $code [description]
* @param string $msg [description]
* @param array $data [description]
* @param string $url [description]
* @param integer $httpCode [description]
* @param array $header [description]
* @param array $options [description]
* @return [type] [description]
*/
function vae_assign($code=200, $msg="OK", $data=[], $url='', $httpCode=200, $header = [], $options = []){
$res=['code'=>$code];
$res['msg']=$msg;
$res['url']=$url;
if(is_object($data)){
$data=$data->toArray();
}
$res['data']=$data;
$response = \think\Response::create($res, "json",$httpCode, $header, $options);
throw new \think\exception\HttpResponseException($response);
}
/**
* 发邮件
* @Author 听雨
* @DateTime 2020-03-20
* @param [type] $toemail 收件邮箱
* @param [type] $toName 收件人称呼
* @param [type] $title 邮件标题
* @param [type] $content 邮件正文
* @param string $fromEmail 发件邮箱
* @param string $fromName 发件人称呼
* @param string $replyEmail 回复邮箱
* @param string $replyName 回复人称呼
* @return [type] [description]
*/
function vae_send_email($toemail, $toName, $title, $content, $fromEmail = "", $fromName = "", $replyEmail = "", $replyName=""){
$config = Config::get('email');
if(NULL == $config) {
abort(0,'请先在系统->配置->邮箱配置中配置您的SMTP信息且完成提交');
}
$fromEmail = $fromEmail?$fromEmail:$config['email'];
$fromName = $fromName?$fromName:$config['from'];
$replyEmail = $replyEmail?$replyEmail:$fromEmail;
$replyName = $replyName?$replyName:$fromName;
$mail = new PHPMailer(true);
//Server settings
// $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->isSMTP(); // Send using SMTP
$mail->CharSet = "utf8"; // 编码格式为utf8不设置编码的话中文会出现乱码
$mail->Host = $config['smtp']; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $config['username']; // SMTP username
$mail->Password = $config['password']; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = $config['port']; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients
$mail->setFrom($fromEmail, "=?UTF-8?B?".base64_encode($fromName)."?=");
$mail->addAddress($toemail, "=?UTF-8?B?".base64_encode($toName)."?="); // Add a recipient
// $mail->addAddress('ellen@example.com'); // Name is optional
$mail->addReplyTo($replyEmail, "=?UTF-8?B?".base64_encode($replyName)."?=");
// $mail->addCC('cc@example.com');
// $mail->addBCC('bcc@example.com');
// Attachments
// $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
// $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "=?UTF-8?B?".base64_encode($title)."?=";
$mail->Body = $content;
// $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
}
/**
* 阿里大鱼发短信
* @Author 听雨
* @DateTime 2020-03-16
* @param [type] $phone [description]
* @param [type] $param [description]
* @param [type] $code [description]
* @param string $type [description]
* @return [type] [description]
*/
function vae_send_sms($phone, $param, $code, $type = "normal")
{
// 配置信息
include root_path()."extend/dayu/top/TopClient.php";
include root_path()."extend/dayu/top/TopLogger.php";
include root_path()."extend/dayu/top/request/AlibabaAliqinFcSmsNumSendRequest.php";
include root_path()."extend/dayu/top/ResultSet.php";
include root_path()."extend/dayu/top/RequestCheckUtil.php";
$c = new \TopClient();
$conf = Config::get('dayu');
$c ->appkey = $conf['appkey'];
$c ->secretKey = $conf['secretkey'];
$req = new \AlibabaAliqinFcSmsNumSendRequest();
//公共回传参数,在“消息返回”中会透传回该参数。非必须
$req ->setExtend("");
//短信类型传入值请填写normal
$req ->setSmsType($type);
//短信签名,传入的短信签名必须是在阿里大于“管理中心-验证码/短信通知/推广短信-配置短信签名”中的可用签名。
$req ->setSmsFreeSignName($conf['FreeSignName']);
//短信模板变量,传参规则{"key":"value"}key的名字须和申请模板中的变量名一致多个变量之间以逗号隔开。
$req ->setSmsParam($param);
//短信接收号码。支持单个或多个手机号码传入号码为11位手机号码不能加0或+86。群发短信需传入多个号码以英文逗号分隔一次调用最多传入200个号码。
$req ->setRecNum($phone);
//短信模板ID传入的模板必须是在阿里大于“管理中心-短信模板管理”中的可用模板。
$req ->setSmsTemplateCode($code);
//发送
$resp = $c ->execute($req);
}
/**
* url中现有的参数+点击的连接中包含的参数合并计算
* @Author 听雨
* @DateTime 2020-03-16
* @param array $params [description]
* @param string $url [description]
* @return [type] [description]
*/
function vae_get_route_url($params = [], $url = '')
{
$get = request()->param();
foreach ($get as $urlparam => $value) {
if (strpos($urlparam, $request()->action())) {
unset($get[$urlparam]);
} else {
$get[$urlparam] = urldecode($value);
}
}
if (is_array($params)) {
$get = array_merge($get, $params);
}
if (empty($url)) {
return url($request()->action(), $get);
} else {
return url($url, $get);
}
}
/**
* 根据导航组的标识获取导航数据集
* @Author 听雨
* @DateTime 2020-03-19
* @param string $key [description]
* @return [type] [description]
*/
function vae_get_nav(string $key)
{
if(Cache::has('NAV_'.$key))
{
$nav = Cache::get('NAV_'.$key);
}
else
{
$groupId = Db::name('nav_group')->where('key',$key)->value('id');
if(!$groupId)
{
return abort('404','导航组不存在');
}
$nav = Db::name('nav')->where('nav_group_id',$groupId)->field('title,icon,app_src,wechat_src,sort')->select()->toArray();
foreach ($nav as $k => $v) {
$nav[$k]['icon'] = Config::get('web.domain').$v['icon'];
}
Cache::set('NAV_'.$key,$nav);
}
return $nav;
}
/**
* 根据轮播组的标识获取轮播数据集
* @Author 听雨
* @DateTime 2020-03-19
* @param string $key [description]
* @return [type] [description]
*/
function vae_get_slide(string $key)
{
if(Cache::has('SLIDE_'.$key))
{
$slide = Cache::get('SLIDE_'.$key);
}
else
{
$groupId = Db::name('slide_group')->where('key',$key)->value('id');
if(!$groupId)
{
return abort('404','轮播组不存在');
}
$slide = Db::name('slide')->where('slide_group_id',$groupId)->field('title,icon,src,sort')->select()->toArray();
foreach ($slide as $k => $v) {
$slide[$k]['icon'] = Config::get('web.domain').$v['icon'];
}
Cache::set('SLIDE_'.$key,$slide);
}
return $slide;
}

17
app/event.php Normal file
View File

@ -0,0 +1,17 @@
<?php
// 事件定义文件
return [
'bind' => [
],
'listen' => [
'AppInit' => [],
'HttpRun' => [],
'HttpEnd' => [],
'LogLevel' => [],
'LogWrite' => [],
],
'subscribe' => [
],
];

View File

@ -0,0 +1,198 @@
<?php
// +----------------------------------------------------------------------
// | vaeThink [ Programming makes me happy ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://www.vaeThink.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +---------------------------------------------------------------------
namespace app\install\controller;
use app\BaseController;
use think\facade\View;
use app\install\validate\Index;
use mysqli;
class Install extends BaseController
{
public function _initialize()
{
parent::_initialize();
static $vaeIsInstalled;
if (empty($vaeIsInstalled)) {
$vaeIsInstalled = file_exists(root_path() . 'install.lock');
if ($vaeIsInstalled) {
return json('你已经安装过该系统!');
}
}
}
public function index()
{
return View::fetch('step1');
}
public function step2()
{
if(!$this->request->param('accept') or $this->request->param('accept') !== 1)
{
json(['code'=>0,'请先接受上一步的条款']);
}
$data = [
'pdo' => class_exists('pdo')?1:0,
'pdo_mysql' => extension_loaded('pdo_mysql')?1:0,
'curl' => extension_loaded('curl')?1:0,
'upload_size' => ini_get('file_uploads')?ini_get('upload_max_filesize'):0,
'session' => function_exists('session_start')?1:0
];
return View::fetch('',['data'=>$data]);
}
public function step3()
{
if(!$this->request->param('accept') or $this->request->param('accept') !== 2)
{
json(['code'=>0,'请先通过上一步的安装环境监测']);
}
return View::fetch();
}
public function createData()
{
if($this->request->isPost()){
$data = $this->request->post();
try {
validate(Index::class)->check($data);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return json(['code'=>0,'msg'=>$e->getMessage()]);
}
// 连接数据库
$link=@new mysqli("{$data['DB_HOST']}:{$data['DB_PORT']}",$data['DB_USER'],$data['DB_PWD']);
// 获取错误信息
$error=$link->connect_error;
if (!is_null($error)) {
// 转义防止和alert中的引号冲突
$error=addslashes($error);
return json(['code'=>0,'msg'=>'数据库链接失败:'.$error]);die;
}
// 设置字符集
$link->query("SET NAMES 'utf8'");
if($link->server_info < 5.0){
return json(['code'=>0,'msg'=>'请将您的mysql升级到5.0以上']);die;
}
// 创建数据库并选中
if(!$link->select_db($data['DB_NAME'])){
$create_sql='CREATE DATABASE IF NOT EXISTS '.$data['DB_NAME'].' DEFAULT CHARACTER SET utf8;';
if(!$link->query($create_sql)){
return json(['code'=>0,'msg'=>'数据库连接失败']);die;
}
$link->select_db($data['DB_NAME']);
}
// 导入sql数据并创建表
$vaethink_sql=file_get_contents(app_path() . 'data/vaethink.sql');
$sql_array=preg_split("/;[\r\n]+/", str_replace("vae_",$data['DB_PREFIX'],$vaethink_sql));
foreach ($sql_array as $k => $v) {
if (!empty($v)) {
$link->query($v);
}
}
//插入管理员
$username = $data['username'];
$password = $data['password'];
$nickname = 'Admin';
$thumb = '/static/admin_static/images/vae.jpg';
$salt = substr(str_shuffle('qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890'), 10, 20);
$password = md5(md5($password.$salt).$salt);
$create_time = time();
$update_time = time();
$caeate_admin_sql = "INSERT INTO ".$data['DB_PREFIX']."admin ".
"(username,pwd, nickname,thumb,salt,create_time,update_time) "
."VALUES "
."('$username','$password','$nickname','$thumb','$salt','$create_time','$update_time')";
if(!$link->query($caeate_admin_sql)) {
return json(['code'=>0,'msg'=>'创建管理员信息失败']);
}
$link->close();
$db_str="
<?php
return [
// 默认使用的数据库连接配置
'default' => 'mysql',
// 自定义时间查询规则
'time_query_rule' => [],
// 自动写入时间戳字段
// true为自动识别类型 false关闭
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
'auto_timestamp' => true,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '{$data['DB_HOST']}',
// 数据库名
'database' => '{$data['DB_NAME']}',
// 用户名
'username' => '{$data['DB_USER']}',
// 密码
'password' => '{$data['DB_PWD']}',
// 端口
'hostport' => '{$data['DB_PORT']}',
// 数据库表前缀
'prefix' => '{$data['DB_PREFIX']}',
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要断线重连
'break_reconnect' => false,
// 监听SQL
'trigger_sql' => true,
// 开启字段缓存
'fields_cache' => false,
// 字段缓存路径
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
],
// 更多的数据库配置信息
]
];";
// 创建数据库配置文件
if(false == file_put_contents(root_path() . "config/database.php",$db_str)) {
return json(['code'=>0,'msg'=>'创建数据库配置文件失败,请检查目录权限']);
}
if(false == file_put_contents(root_path() . "install.lock",'vaeThink安装鉴定文件勿删此次安装时间'.date('Y-m-d H:i:s',time()))) {
return josn(['code'=>0,'msg'=>'创建安装鉴定文件失败,请检查目录权限']);
}
return json(['code'=>1,'msg'=>'安装成功']);
}
}
}

View File

@ -0,0 +1,306 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Version : 80012
Source Host : 127.0.0.1:3306
Source Database : pwtp6
Target Server Type : MYSQL
Target Server Version : 80012
File Encoding : 65001
Date: 2020-03-31 18:00:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for vae_admin
-- ----------------------------
DROP TABLE IF EXISTS `vae_admin`;
CREATE TABLE `vae_admin` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL DEFAULT '',
`pwd` varchar(255) NOT NULL DEFAULT '',
`salt` varchar(50) NOT NULL DEFAULT '',
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常-1禁止登陆',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
`last_login_time` int(11) NOT NULL DEFAULT '0',
`last_login_ip` varchar(100) NOT NULL DEFAULT '',
`nickname` varchar(255) DEFAULT '',
`desc` text COMMENT '备注',
`thumb` varchar(200) DEFAULT NULL,
`groups` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组,隔开',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`id`,`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员';
-- ----------------------------
-- Records of vae_admin
-- ----------------------------
-- ----------------------------
-- Table structure for vae_admin_group
-- ----------------------------
DROP TABLE IF EXISTS `vae_admin_group`;
CREATE TABLE `vae_admin_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`status` int(1) NOT NULL DEFAULT '1',
`rules` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '用户组拥有的规则id 多个规则","隔开',
`desc` text COMMENT '备注',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限分组';
-- ----------------------------
-- Records of vae_admin_group
-- ----------------------------
-- ----------------------------
-- Table structure for vae_admin_rule
-- ----------------------------
DROP TABLE IF EXISTS `vae_admin_rule`;
CREATE TABLE `vae_admin_rule` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(11) unsigned NOT NULL DEFAULT '0',
`src` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则',
`title` varchar(255) NOT NULL DEFAULT '',
`is_menu` int(1) NOT NULL DEFAULT '1' COMMENT '1是菜单2不是',
`font_family` varchar(50) DEFAULT '' COMMENT '图标来源',
`icon` varchar(100) DEFAULT NULL COMMENT '图标',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,越大越靠前',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL COMMENT '0',
PRIMARY KEY (`id`),
KEY `name` (`src`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 COMMENT='权限节点';
-- ----------------------------
-- Records of vae_admin_rule
-- ----------------------------
INSERT INTO `vae_admin_rule` VALUES ('1', '0', '', '系统', '1', '', 'layui-icon-windows', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('2', '1', 'menu/index', '菜单', '1', '', 'layui-icon-tree', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('3', '2', 'menu/add', '添加菜单', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('4', '2', 'menu/edit', '修改菜单', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('5', '2', 'menu/delete', '删除菜单', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('6', '14', 'admin/index', '管理员', '1', '', 'layui-icon-friends', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('7', '6', 'admin/add', '添加管理员', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('8', '6', 'admin/edit', '修改管理员', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('9', '6', 'admin/delete', '删除管理员', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('10', '14', 'group/index', '管理组', '1', '', 'layui-icon-user', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('11', '10', 'group/add', '添加权限组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('12', '10', 'group/edit', '修改权限组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('13', '10', 'group/delete', '删除权限组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('14', '1', '', '安全', '1', '', 'layui-icon-auz', '-1', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('15', '1', 'conf/index', '配置', '1', '', 'layui-icon-set', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('16', '15', 'conf/confsubmit', '提交配置', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('17', '0', '', '应用', '1', '', 'layui-icon-app', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('18', '17', 'nav/index', '导航', '1', '', 'layui-icon-component', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('19', '18', 'nav/addgroup', '添加导航组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('20', '18', 'nav/editgroup', '修改导航组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('21', '18', 'nav/deletegroup', '删除导航组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('22', '18', 'nav/navindex', '导航集', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('23', '18', 'nav/addnav', '添加导航', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('24', '18', 'nav/editnav', '修改导航', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('25', '18', 'nav/deletenav', '删除导航', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('26', '1', 'route/index', '路由', '1', '', 'layui-icon-link', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('27', '26', 'route/add', '添加美化', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('28', '26', 'route/edit', '修改美化', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('29', '26', 'route/delete', '删除美化', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('31', '17', 'slide/index', '轮播', '1', '', 'layui-icon-carousel', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('32', '17', 'cate/index', '分类', '1', '', 'layui-icon-tree', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('34', '31', 'slide/addgroup', '添加轮播组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('35', '31', 'slide/editgroup', '修改轮播组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('36', '31', 'slide/deletegroup', '删除轮播组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('37', '31', 'slide/slideindex', '轮播集', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('38', '31', 'slide/addslide', '添加轮播图', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('39', '31', 'slide/editslide', '修改轮播图', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('40', '31', 'slide/deleteslide', '删除轮播图', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('41', '32', 'cate/addgroup', '添加分类组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('42', '32', 'cate/editgroup', '修改分类组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('43', '32', 'cate/deletegroup', '删除分类组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('44', '32', 'cate/cateindex', '分类集', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('45', '32', 'cate/addcate', '添加分类', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('46', '32', 'cate/editcate', '修改分类', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('47', '32', 'cate/deletecate', '删除分类', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('48', '17', 'content/index', '内容', '1', '', 'layui-icon-template-1', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('49', '48', 'content/addgroup', '添加内容组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('50', '48', 'content/editgroup', '修改内容组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('51', '48', 'content/deletegroup', '删除内容组', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('52', '48', 'content/addcontent', '添加内容', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('53', '48', 'content/editcontent', '修改内容', '0', '', '', '0', '0', '0');
INSERT INTO `vae_admin_rule` VALUES ('54', '48', 'content/deletecontent', '删除内容', '0', '', '', '0', '0', '0');
-- ----------------------------
-- Table structure for vae_cate
-- ----------------------------
DROP TABLE IF EXISTS `vae_cate`;
CREATE TABLE `vae_cate` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`pid` int(11) NOT NULL DEFAULT '0',
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
`cate_group_id` int(11) NOT NULL DEFAULT '0',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类';
-- ----------------------------
-- Records of vae_cate
-- ----------------------------
-- ----------------------------
-- Table structure for vae_cate_group
-- ----------------------------
DROP TABLE IF EXISTS `vae_cate_group`;
CREATE TABLE `vae_cate_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`key` varchar(50) NOT NULL,
`desc` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类分组';
-- ----------------------------
-- Records of vae_cate_group
-- ----------------------------
-- ----------------------------
-- Table structure for vae_content
-- ----------------------------
DROP TABLE IF EXISTS `vae_content`;
CREATE TABLE `vae_content` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`img` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '图片,多图用,隔开',
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`desc` varchar(500) DEFAULT NULL COMMENT '概要',
`content` text COMMENT '详情',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
`content_group_id` int(11) NOT NULL DEFAULT '0',
`cate_id` int(11) NOT NULL DEFAULT '0',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='内容';
-- ----------------------------
-- Records of vae_content
-- ----------------------------
-- ----------------------------
-- Table structure for vae_content_group
-- ----------------------------
DROP TABLE IF EXISTS `vae_content_group`;
CREATE TABLE `vae_content_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`key` varchar(50) NOT NULL,
`cate_group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分类组id',
`desc` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='内容分组';
-- ----------------------------
-- Records of vae_content_group
-- ----------------------------
-- ----------------------------
-- Table structure for vae_nav
-- ----------------------------
DROP TABLE IF EXISTS `vae_nav`;
CREATE TABLE `vae_nav` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`icon` varchar(255) NOT NULL,
`src` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
`nav_group_id` int(11) NOT NULL DEFAULT '0',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='导航';
-- ----------------------------
-- Records of vae_nav
-- ----------------------------
-- ----------------------------
-- Table structure for vae_nav_group
-- ----------------------------
DROP TABLE IF EXISTS `vae_nav_group`;
CREATE TABLE `vae_nav_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`key` varchar(50) NOT NULL,
`desc` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='导航分组';
-- ----------------------------
-- Records of vae_nav_group
-- ----------------------------
-- ----------------------------
-- Table structure for vae_route
-- ----------------------------
DROP TABLE IF EXISTS `vae_route`;
CREATE TABLE `vae_route` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`module` varchar(255) NOT NULL DEFAULT '' COMMENT '应用名',
`full_url` varchar(255) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1启用-1禁用',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='路由设置';
-- ----------------------------
-- Records of vae_route
-- ----------------------------
-- ----------------------------
-- Table structure for vae_slide
-- ----------------------------
DROP TABLE IF EXISTS `vae_slide`;
CREATE TABLE `vae_slide` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`icon` varchar(255) NOT NULL,
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
`src` varchar(255) DEFAULT NULL,
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
`slide_group_id` int(11) NOT NULL DEFAULT '0',
`create_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='轮播';
-- ----------------------------
-- Records of vae_slide
-- ----------------------------
-- ----------------------------
-- Table structure for vae_slide_group
-- ----------------------------
DROP TABLE IF EXISTS `vae_slide_group`;
CREATE TABLE `vae_slide_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`key` varchar(50) NOT NULL,
`desc` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='轮播分组';
-- ----------------------------
-- Records of vae_slide_group
-- ----------------------------

View File

@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | vaeThink [ Programming makes me happy ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://www.vaeThink.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +---------------------------------------------------------------------
namespace app\install\validate;
use think\Validate;
class Index extends Validate
{
protected $rule = [
'DB_TYPE' => 'require|eq:mysql',
'DB_HOST' => 'require',
'DB_PORT' => 'require',
'DB_USER' => 'require',
'DB_PWD' => 'require',
'DB_NAME' => 'require',
'DB_PREFIX' => 'require',
'username' => 'require',
'password' => 'require|confirm',
];
protected $message = [
'DB_TYPE.require' => '数据库类型不能为空',
'DB_TYPE.eq' => '数据库类型固定为mysql',
'DB_HOST.require' => '数据库地址不能为空',
'DB_PORT.require' => '数据库端口不能为空',
'DB_USER.require' => '数据库用户名不能为空',
'DB_PWD.require' => '数据库密码不能为空',
'DB_NAME.require' => '数据库名字不能为空',
'DB_PREFIX.require' => '表前缀不能为空',
'username.require' => '管理员账户不能为空',
'password.require' => '密码不能为空',
'password.confirm' => '两次密码不一致',
];
protected $scene = [
];
}

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vaeThink</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/admin_static/lib/layui/css/layui.css" media="all">
</head>
<body>
<div style="width:800px;margin: 100px auto;">
<div class="layui-layout layui-layout-admin">
<div class="layui-header layui-bg-cyan">
<div class="layui-logo" style="color: #fff">vaeThink 安装引导</div>
</div>
<div style="border:1px solid #eee;padding:20px;line-height: 25px;">
<p>
欢迎使用vaeThinkvaeThink搭载了最新的ThinkPHP6.x和最新的Layui2.x是一款轻量级、高速度的PHP权限管理系统。<br>
您在使用中如有任何问题都可以登录<a href="http://vaethink.com" target="_blank" style="color:blue">vaeThink官方网站</a>获取帮助。<br><br>
开源协议:<br>
vaeThink遵循Apache Lisense 2.0开源协议发布,并提供免费使用。<br>
Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似鼓励代码共享和尊重原作者的著作权允许代码修改再作为开源或商业软件发布。需要满足的条件<br>
1、需要给用户一份Apache Licence <br>
2、如果你修改了代码需要在被修改的文件中说明<br>
3、在延伸的代码中修改和有源代码衍生的代码中需要带有原来代码中的协议商标专利声明和其他原来作者规定需要包含的说明<br>
4、如果再发布的产品中包含一个Notice文件则在Notice文件中需要带有本协议内容。你可以在Notice中增加自己的许可但不可以表现为对Apache Licence构成更改。<br><br>
免责声明:<br>
1、使用vaeThink构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果vaeThink官方不承担任何责任。
2、您一旦安装使用vaeThink即被视为完全理解并接受本协议的各项条款在享有上述条款授予的权力的同时受到相关的约束和限制。
</p>
<div style="margin:10px auto;width: 90px;">
<a href="{:url('install/install/step2',['accept'=>1])}" class="layui-btn layui-bg-cyan">接受协议</a>
</div>
</div>
</div>
</div>
<script src="/static/admin_static/lib/layui/layui.js" charset="utf-8"></script>
</body>
</html>

View File

@ -0,0 +1,164 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vaeThink</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/admin_static/lib/layui/css/layui.css" media="all">
</head>
<body>
<div style="width:800px;margin: 100px auto;">
<div class="layui-layout layui-layout-admin">
<div class="layui-header layui-bg-cyan">
<div class="layui-logo" style="color: #fff">vaeThink 安装引导</div>
</div>
<div style="border:1px solid #eee;padding:20px;line-height: 25px;">
<h3>环境检测</h3>
<table class="layui-table" lay-skin="nob" lay-size="sm">
<colgroup>
<col width="150">
<col width="200">
<col width="200">
<col width="100">
<col>
</colgroup>
<thead>
<tr>
<th>环境</th>
<th>最低配置</th>
<th>当前配置</th>
<th>是否符合</th>
</tr>
</thead>
<tbody>
<tr>
<td>操作系统</td>
<td>不限</td>
<td><?php echo php_uname('s'); ?></td>
<td class="yes"><i class="layui-icon layui-icon-ok"></i></td>
</tr>
<tr>
<td>php版本</td>
<td>≥ 7.1</td>
<td><?php echo PHP_VERSION ?></td>
<?php $php_version=explode('.', PHP_VERSION); ?>
<td class="<?php if($php_version['0']>=7 && $php_version['1']>=1)echo 'yes'; ?>">
<?php if ($php_version['0']>=7 && $php_version['1']>=1): ?>
<i class="layui-icon layui-icon-ok"></i>
<?php else: ?>
<i class="layui-icon layui-icon-close"></i>
<?php endif ?>
</td>
</tr>
</tbody>
</table>
<h3>模块检测</h3>
<table class="layui-table" lay-skin="nob" lay-size="sm">
<colgroup>
<col width="150">
<col width="200">
<col width="200">
<col width="100">
<col>
</colgroup>
<thead>
<tr>
<th>环境</th>
<th>最低配置</th>
<th>当前配置</th>
<th>是否符合</th>
</tr>
</thead>
<tbody>
<tr>
<td>session</td>
<td>支持</td>
<td>{eq name="$data.session" value="1"}支持{else /}不支持{/eq}</td>
<td><i class="layui-icon {eq name="$data.session" value="1"}layui-icon-ok yes{else /}layui-icon-close{/eq}"></i></td>
</tr>
<tr>
<td>PDO</td>
<td>开启</td>
<td>{eq name="$data.pdo" value="1"}已开启{else /}未开启{/eq}</td>
<td><i class="layui-icon {eq name="$data.pdo" value="1"}layui-icon-ok yes{else /}layui-icon-close{/eq}"></i></td>
</tr>
<tr>
<td>PDO_Mysql</td>
<td>开启</td>
<td>{eq name="$data.pdo_mysql" value="1"}已开启{else /}未开启{/eq}</td>
<td><i class="layui-icon {eq name="$data.pdo_mysql" value="1"}layui-icon-ok yes{else /}layui-icon-close{/eq}"></i></td>
</tr>
<tr>
<td>上传限制</td>
<td>≥ 2M</td>
<td>{eq name="$data.upload_size" value="0"}不支持{else /}{$data.upload_size}{/eq}</td>
<td><i class="layui-icon {eq name="$data.upload_size" value="0"}layui-icon-close{else /}layui-icon-ok yes{/eq}"></i></td>
</tr>
</tbody>
</table>
<h3>目录权限</h3>
<table class="layui-table" lay-skin="nob" lay-size="sm">
<colgroup>
<col width="150">
<col width="200">
<col width="200">
<col width="100">
<col>
</colgroup>
<thead>
<tr>
<th>环境</th>
<th>最低配置</th>
<th>当前配置</th>
<th>是否符合</th>
</tr>
</thead>
<tbody>
<tr>
<td>config</td>
<td>可写</td>
<td>
<?php if (is_writable(config_path())): ?>
可写
<?php else: ?>
不可写
<?php endif ?>
</td>
<td class="<?php if(is_writable(config_path()))echo 'yes'; ?>">
<?php if (is_writable(config_path())): ?>
<i class="layui-icon layui-icon-ok"></i>
<?php else: ?>
<i class="layui-icon layui-icon-close"></i>
<?php endif ?>
</td>
</tr>
</tbody>
</table>
<div style="margin:10px auto;width: 190px;">
<a href="{:url('install/install/index')}" class="layui-btn layui-bg-cyan">上一步</a>
<a href="javascript:;" class="layui-btn layui-bg-cyan" id="step2">下一步</a>
</div>
</div>
</div>
</div>
<script src="/static/admin_static/lib/layui/layui.js" charset="utf-8"></script>
<script>
layui.use(['jquery','layer'], function(){
var $ = layui.jquery,layer = layui.layer;
$('#step2').click(function(){
if($('.yes').length!=7){
layer.tips('您的配置或权限不符合要求',this);
}else{
location.href="{:url('install/install/step3',['accept'=>2])}";
}
})
});
</script>
</body>
</html>

View File

@ -0,0 +1,171 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vaeThink</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/admin_static/lib/layui/css/layui.css" media="all">
</head>
<body>
<div style="width:800px;margin: 100px auto;">
<div class="layui-layout layui-layout-admin">
<div class="layui-header layui-bg-cyan">
<div class="layui-logo" style="color: #fff">vaeThink 安装引导</div>
</div>
<div style="border:1px solid #eee;padding:20px;line-height: 25px;">
<h3>数据库配置</h3><br>
<form class="layui-form" action="" id="form">
<div class="layui-form-item">
<label class="layui-form-label">数据库类型</label>
<div class="layui-input-inline">
<input type="text" name="DB_TYPE" required lay-verify="required" autocomplete="off" class="layui-input" value="mysql" disabled="disabled">
</div>
<div class="layui-form-mid layui-word-aux">固定为mysql</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库地址</label>
<div class="layui-input-inline">
<input type="text" name="DB_HOST" required lay-verify="required" autocomplete="off" class="layui-input" value="127.0.0.1">
</div>
<div class="layui-form-mid layui-word-aux">本地数据库地址一般为127.0.0.1</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库端口</label>
<div class="layui-input-inline">
<input type="text" name="DB_PORT" required lay-verify="required" autocomplete="off" class="layui-input" value="3306">
</div>
<div class="layui-form-mid layui-word-aux">数据库端口一般为3306</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">用户名</label>
<div class="layui-input-inline">
<input type="text" name="DB_USER" required lay-verify="required" autocomplete="off" class="layui-input" value="root">
</div>
<div class="layui-form-mid layui-word-aux">你数据库的连接用户名</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="DB_PWD" required lay-verify="required" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">你数据库的连接密码</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库名</label>
<div class="layui-input-inline">
<input type="text" name="DB_NAME" required lay-verify="required" autocomplete="off" class="layui-input" value="vaethink">
</div>
<div class="layui-form-mid layui-word-aux">不能有"-"等特殊符号</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">表前缀</label>
<div class="layui-input-inline">
<input type="text" name="DB_PREFIX" required lay-verify="required" autocomplete="off" class="layui-input" value="vae_">
</div>
<div class="layui-form-mid layui-word-aux">建议使用默认同一个数据库安装多个vaeThink时需更改否则会覆盖</div>
</div>
<hr>
<h3>管理员配置</h3><br>
<div class="layui-form-item">
<label class="layui-form-label">账户</label>
<div class="layui-input-block" style="max-width: 500px;">
<input type="text" name="username" lay-verify="required" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" lay-verify="required" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">确认密码</label>
<div class="layui-input-inline">
<input type="password" name="password_confirm" lay-verify="required" autocomplete="off" class="layui-input">
</div>
</div>
<br>
<div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="demo" style="display: none;" id="progress">
<div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
</div>
<div class="layui-form-item">
<div style="margin:10px auto;width: 190px;">
<a href="{:url('install/install/step2',['accept'=>1])}" class="layui-btn layui-bg-cyan">上一步</a>
<button class="layui-btn layui-bg-cyan" lay-submit="" lay-filter="formDemo">开始安装</button>
</div>
</div>
</form>
<div style="display: none;text-align: center;" id="complete">
<h1>安装完成!</h1><br><br><br>
<a href="{:url('admin/index/index')}" class="layui-btn layui-bg-cyan">访问后台</a>
</div>
</div>
</div>
</div>
<script src="/static/admin_static/lib/layui/layui.js" charset="utf-8"></script>
<script>
layui.use(['element','jquery','layer','form'], function(){
var $ = layui.jquery,layer = layui.layer,form = layui.form,element = layui.element;
var n = 0;
//监听提交
form.on('submit(formDemo)', function(data){
$('#progress').css('display','block');
var timer = setInterval(function(){
n = n + Math.random()*10|0;
if(n>99){
n = 99;
clearInterval(timer);
}
element.progress('demo', n+'%');
}, 30+Math.random()*100);
$.ajax({
url:"{:url('install/install/createData')}",
type:"post",
data:data.field,
beforeSend: function () {
// 禁用按钮防止重复提交
$("#formDemo").attr({ disabled: "disabled" });
$('#formDemo').html('创建中...');
},
success:function(res){
if(res.code==0){
$('#progress').css('display','none');
layer.msg(res.msg);
} else {
if(n==99){
element.progress('demo', 100+'%');
$('#form').hide();
$('#complete').show();
return false;
} else if(n<99) {
var ref = setInterval(function(){
if(n==99){
clearInterval(ref);
element.progress('demo', 100+'%');
$('#form').hide();
$('#complete').show();
}
},500)
}
}
},
complete: function () {
$("#formDemo").removeAttr("disabled");
$('#formDemo').html('提交');
}
})
return false;
});
});
</script>
</body>
</html>

10
app/middleware.php Normal file
View File

@ -0,0 +1,10 @@
<?php
// 全局中间件定义文件
return [
// 全局请求缓存
// \think\middleware\CheckRequestCache::class,
// 多语言加载
// \think\middleware\LoadLangPack::class,
// 注册Route中间件
\app\middleware\Route::class,
];

54
app/middleware/Route.php Normal file
View File

@ -0,0 +1,54 @@
<?php
declare (strict_types = 1);
namespace app\middleware;
use think\facade\Db;
class Route
{
public function handle($request, \Closure $next)
{
// 检查是否完成安装
if(file_exists(root_path() . 'install.lock'))
{
$module = app('http')->getName();
if(!file_exists(root_path() . '/route/'.$module.'/app.php'))
{
$route = Db::name('route')->where('module',$module)->where('status',1)->count();
if($route > 0)
{
if (!file_exists(root_path() . '/route/'.$module))
{
mkdir (root_path() . '/route/'.$module,0777);
}
$route_str='
<?php
use think\facade\Route;
use think\facade\Db;
use think\facade\Cache;
$module = app("http")->getName();
if(Cache::has("route_".$module)) {
$runtimeRoute = Cache::get("route".$module);
} else {
$runtimeRoute = Db::name("route")->where("module",$module)->where("status", 1)->order("create_time asc")->column("full_url","url");
Cache::set("route".$module,$runtimeRoute);
}
foreach ($runtimeRoute as $k => $v) {
Route::rule($k,$v);
}';
// 创建应用路由配置文件
if(false == file_put_contents(root_path() . '/route/'.$module.'/app.php',$route_str)) {
return abort(404,'创建路由配置文件失败请检查route目录的权限');
}
}
}
}
return $next($request);
}
}

9
app/provider.php Normal file
View File

@ -0,0 +1,9 @@
<?php
use app\ExceptionHandle;
use app\Request;
// 容器Provider定义文件
return [
'think\Request' => Request::class,
'think\exception\Handle' => ExceptionHandle::class,
];

48
composer.json Normal file
View File

@ -0,0 +1,48 @@
{
"name": "topthink/think",
"description": "the new thinkphp framework",
"type": "project",
"keywords": [
"framework",
"thinkphp",
"ORM"
],
"homepage": "http://thinkphp.cn/",
"license": "Apache-2.0",
"authors": [
{
"name": "liu21st",
"email": "liu21st@gmail.com"
}
],
"require": {
"php": ">=7.1.0",
"topthink/framework": "^6.0.0",
"topthink/think-orm": "^2.0",
"topthink/think-multi-app": "^1.0",
"topthink/think-view": "^1.0",
"topthink/think-captcha": "^3.0",
"phpmailer/phpmailer": "^6.1"
},
"require-dev": {
"symfony/var-dumper": "^4.2",
"topthink/think-trace":"^1.0"
},
"autoload": {
"psr-4": {
"app\\": "app"
},
"psr-0": {
"": "extend/"
}
},
"config": {
"preferred-install": "dist"
},
"scripts": {
"post-autoload-dump": [
"@php think service:discover",
"@php think vendor:publish"
]
}
}

1129
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

36
config/app.php Normal file
View File

@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | 应用设置
// +----------------------------------------------------------------------
use think\facade\Env;
return [
// 应用地址
'app_host' => Env::get('app.host', ''),
// 应用的命名空间
'app_namespace' => '',
// 是否启用路由
'with_route' => true,
// 是否启用事件
'with_event' => true,
// 默认应用
'default_app' => 'index',
// 默认时区
'default_timezone' => 'Asia/Shanghai',
// 应用映射(自动多应用模式有效)
'app_map' => [],
// 域名绑定(自动多应用模式有效)
'domain_bind' => [],
// 禁止URL访问的应用列表自动多应用模式有效
'deny_app_list' => [],
// 异常页面的模板文件
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
// 错误显示信息,非调试模式有效
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => false,
];

30
config/cache.php Normal file
View File

@ -0,0 +1,30 @@
<?php
use think\facade\Env;
// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
return [
// 默认缓存驱动
'default' => Env::get('cache.driver', 'file'),
// 缓存连接方式配置
'stores' => [
'file' => [
// 驱动方式
'type' => 'File',
// 缓存保存目录
'path' => '',
// 缓存前缀
'prefix' => '',
// 缓存有效期 0表示永久缓存
'expire' => 0,
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
// 更多的缓存连接
],
];

39
config/captcha.php Normal file
View File

@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | Captcha配置文件
// +----------------------------------------------------------------------
return [
//验证码位数
'length' => 5,
// 验证码字符集合
'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
// 验证码过期时间
'expire' => 1800,
// 是否使用中文验证码
'useZh' => false,
// 是否使用算术验证码
'math' => true,
// 是否使用背景图
'useImgBg' => false,
//验证码字符大小
'fontSize' => 25,
// 是否使用混淆曲线
'useCurve' => true,
//是否添加杂点
'useNoise' => true,
// 验证码字体 不设置则随机
'fontttf' => '',
//背景颜色
'bg' => [243, 251, 254],
// 验证码图片高度
'imageH' => 0,
// 验证码图片宽度
'imageW' => 0,
// 添加额外的验证码设置
// verify => [
// 'length'=>4,
// ...
//],
];

9
config/console.php Normal file
View File

@ -0,0 +1,9 @@
<?php
// +----------------------------------------------------------------------
// | 控制台配置
// +----------------------------------------------------------------------
return [
// 指令定义
'commands' => [
],
];

18
config/cookie.php Normal file
View File

@ -0,0 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | Cookie设置
// +----------------------------------------------------------------------
return [
// cookie 保存时间
'expire' => 0,
// cookie 保存路径
'path' => '/',
// cookie 有效域名
'domain' => '',
// cookie 启用安全传输
'secure' => false,
// httponly设置
'httponly' => false,
// 是否使用 setcookie
'setcookie' => true,
];

59
config/database.php Normal file
View File

@ -0,0 +1,59 @@
<?php
return [
// 默认使用的数据库连接配置
'default' => 'mysql',
// 自定义时间查询规则
'time_query_rule' => [],
// 自动写入时间戳字段
// true为自动识别类型 false关闭
// 字符串则明确指定时间字段类型 支持 int timestamp datetime date
'auto_timestamp' => true,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 数据库连接配置信息
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '127.0.0.1',
// 数据库名
'database' => 'pwtp6',
// 用户名
'username' => 'root',
// 密码
'password' => 'root',
// 端口
'hostport' => '3306',
// 数据库表前缀
'prefix' => 'vae_',
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 是否需要断线重连
'break_reconnect' => false,
// 监听SQL
'trigger_sql' => true,
// 开启字段缓存
'fields_cache' => false,
// 字段缓存路径
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
],
// 更多的数据库配置信息
]
];

26
config/filesystem.php Normal file
View File

@ -0,0 +1,26 @@
<?php
use think\facade\Env;
return [
// 默认磁盘
'default' => Env::get('filesystem.driver', 'local'),
// 磁盘列表
'disks' => [
'local' => [
'type' => 'local',
'root' => app()->getRuntimePath() . 'storage',
],
'public' => [
// 磁盘类型
'type' => 'local',
// 磁盘路径
'root' => app()->getRootPath() . 'public/storage',
// 磁盘路径对应的外部URL路径
'url' => '/storage',
// 可见性
'visibility' => 'public',
],
// 更多的磁盘配置信息
],
];

27
config/lang.php Normal file
View File

@ -0,0 +1,27 @@
<?php
// +----------------------------------------------------------------------
// | 多语言设置
// +----------------------------------------------------------------------
use think\facade\Env;
return [
// 默认语言
'default_lang' => Env::get('lang.default_lang', 'zh-cn'),
// 允许的语言列表
'allow_lang_list' => [],
// 多语言自动侦测变量名
'detect_var' => 'lang',
// 是否使用Cookie记录
'use_cookie' => true,
// 多语言cookie变量
'cookie_var' => 'think_lang',
// 扩展语言包
'extend_list' => [],
// Accept-Language转义为对应语言包名称
'accept_language' => [
'zh-hans-cn' => 'zh-cn',
],
// 是否支持语言分组
'allow_group' => false,
];

46
config/log.php Normal file
View File

@ -0,0 +1,46 @@
<?php
use think\facade\Env;
// +----------------------------------------------------------------------
// | 日志设置
// +----------------------------------------------------------------------
return [
// 默认日志记录通道
'default' => Env::get('log.channel', 'file'),
// 日志记录级别
'level' => [],
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 关闭全局日志写入
'close' => false,
// 全局日志处理 支持闭包
'processor' => null,
// 日志通道列表
'channels' => [
'file' => [
// 日志记录方式
'type' => 'File',
// 日志保存目录
'path' => '',
// 单文件日志写入
'single' => false,
// 独立日志级别
'apart_level' => [],
// 最大日志文件数量
'max_files' => 0,
// 使用JSON格式记录
'json' => false,
// 日志处理
'processor' => null,
// 关闭通道日志写入
'close' => false,
// 日志输出格式化
'format' => '[%s][%s] %s',
// 是否实时写入
'realtime_write' => false,
],
// 其它日志通道配置
],
];

8
config/middleware.php Normal file
View File

@ -0,0 +1,8 @@
<?php
// 中间件配置
return [
// 别名或分组
'alias' => [],
// 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
'priority' => [],
];

45
config/route.php Normal file
View File

@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | 路由设置
// +----------------------------------------------------------------------
return [
// pathinfo分隔符
'pathinfo_depr' => '/',
// URL伪静态后缀
'url_html_suffix' => 'html',
// URL普通方式参数 用于自动生成
'url_common_param' => true,
// 是否开启路由延迟解析
'url_lazy_route' => false,
// 是否强制使用路由
'url_route_must' => false,
// 合并路由规则
'route_rule_merge' => false,
// 路由是否完全匹配
'route_complete_match' => false,
// 访问控制器层名称
'controller_layer' => 'controller',
// 空控制器名
'empty_controller' => 'Error',
// 是否使用控制器后缀
'controller_suffix' => false,
// 默认的路由变量规则
'default_route_pattern' => '[\w\.]+',
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
'request_cache' => false,
// 请求缓存有效期
'request_cache_expire' => null,
// 全局请求缓存排除规则
'request_cache_except' => [],
// 默认控制器名
'default_controller' => 'Index',
// 默认操作名
'default_action' => 'index',
// 操作方法后缀
'action_suffix' => '',
// 默认JSONP格式返回的处理方法
'default_jsonp_handler' => 'jsonpReturn',
// 默认JSONP处理方法
'var_jsonp_handler' => 'callback',
];

19
config/session.php Normal file
View File

@ -0,0 +1,19 @@
<?php
// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------
return [
// session name
'name' => 'PHPSESSID',
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '',
// 驱动方式 支持file cache
'type' => 'file',
// 存储连接标识 当type使用cache的时候有效
'store' => null,
// 过期时间
'expire' => 1440,
// 前缀
'prefix' => '',
];

10
config/trace.php Normal file
View File

@ -0,0 +1,10 @@
<?php
// +----------------------------------------------------------------------
// | Trace设置 开启调试模式后有效
// +----------------------------------------------------------------------
return [
// 内置Html和Console两种方式 支持扩展
'type' => 'Html',
// 读取的日志通道名
'channel' => '',
];

25
config/view.php Normal file
View File

@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
];

1
install.lock Normal file
View File

@ -0,0 +1 @@
vaeThink安装鉴定文件勿删此次安装时间2020-04-01 08:54:34

Some files were not shown because too many files have changed in this diff Show More