作者 魏强

上传

<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
function sp_testwrite($d)
{
$tfile = "_test.txt";
$fp = @fopen($d . "/" . $tfile, "w");
if (!$fp) {
return false;
}
fclose($fp);
$rs = @unlink($d . "/" . $tfile);
if ($rs) {
return true;
}
return false;
}
function sp_dir_create($path, $mode = 0777)
{
if (is_dir($path))
return true;
$ftp_enable = 0;
$path = sp_dir_path($path);
$temp = explode('/', $path);
$cur_dir = '';
$max = count($temp) - 1;
for ($i = 0; $i < $max; $i++) {
$cur_dir .= $temp[$i] . '/';
if (@is_dir($cur_dir))
continue;
@mkdir($cur_dir, 0777, true);
@chmod($cur_dir, 0777);
}
return is_dir($path);
}
function sp_dir_path($path)
{
$path = str_replace('\\', '/', $path);
if (substr($path, -1) != '/')
$path = $path . '/';
return $path;
}
function sp_execute_sql($db, $sql)
{
$sql = trim($sql);
preg_match('/CREATE TABLE .+ `([^ ]*)`/', $sql, $matches);
if ($matches) {
$table_name = $matches[1];
$msg = "创建数据表{$table_name}";
try {
$db->execute($sql);
return [
'error' => 0,
'message' => $msg . ' 成功!'
];
} catch (\Exception $e) {
return [
'error' => 1,
'message' => $msg . ' 失败!',
'exception' => $e->getTraceAsString()
];
}
} else {
try {
$db->execute($sql);
return [
'error' => 0,
'message' => 'SQL执行成功!'
];
} catch (\Exception $e) {
return [
'error' => 1,
'message' => 'SQL执行失败!',
'exception' => $e->getTraceAsString()
];
}
}
}
/**
* 显示提示信息
* @param string $msg 提示信息
*/
function sp_show_msg($msg, $class = '')
{
echo "<script type=\"text/javascript\">showmsg(\"{$msg}\", \"{$class}\")</script>";
flush();
ob_flush();
}
function sp_update_site_configs($db, $table_prefix)
{
$sitename = I("post.sitename");
$email = I("post.manager_email");
$siteurl = I("post.siteurl");
$seo_keywords = I("post.sitekeywords");
$seo_description = I("post.siteinfo");
$site_options = <<<helllo
{
"site_name":"$sitename",
"site_host":"$siteurl",
"site_root":"",
"site_icp":"",
"site_admin_email":"$email",
"site_tongji":"",
"site_copyright":"",
"site_seo_title":"$sitename",
"site_seo_keywords":"$seo_keywords",
"site_seo_description":"$seo_description"
}
helllo;
$sql = "INSERT INTO `{$table_prefix}options` (option_value,option_name) VALUES ('$site_options','site_options')";
$db->execute($sql);
sp_show_msg("网站信息配置成功!");
}
function sp_create_admin_account($db, $table_prefix, $authcode)
{
$username = I("post.manager");
$password = sp_password(I("post.manager_pwd"), $authcode);
$email = I("post.manager_email");
$create_date = date("Y-m-d h:i:s");
$ip = get_client_ip(0, true);
$sql = <<<hello
INSERT INTO `{$table_prefix}users`
(id,user_login,user_pass,user_nicename,user_email,user_url,create_time,user_activation_key,user_status,last_login_ip,last_login_time) VALUES
('1', '{$username}', '{$password}', 'admin', '{$email}', '', '{$create_date}', '', '1', '{$ip}','{$create_date}');;
hello;
$db->execute($sql);
sp_show_msg("管理员账号创建成功!");
}
/**
* 写入配置文件
* @param array $config 配置信息
*/
function sp_create_config($config, $authcode)
{
if (is_array($config)) {
//读取配置内容
$conf = file_get_contents(MODULE_PATH . 'Data/config.php');
//替换配置项
foreach ($config as $key => $value) {
$conf = str_replace("#{$key}#", $value, $conf);
}
$conf = str_replace('#AUTHCODE#', $authcode, $conf);
$conf = str_replace('#COOKIE_PREFIX#', sp_random_string(6) . "_", $conf);
//写入应用配置文件
if (file_put_contents('data/conf/db.php', $conf)) {
sp_show_msg('配置文件写入成功');
} else {
sp_show_msg('配置文件写入失败!', 'error');
}
return '';
}
}
function sp_create_db_config($config)
{
if (is_array($config)) {
//读取配置内容
$conf = file_get_contents(APP_PATH . 'install/data/config.php');
//替换配置项
foreach ($config as $key => $value) {
$conf = str_replace("#{$key}#", $value, $conf);
}
try {
$confDir = CMF_ROOT . 'data/conf/';
if (!file_exists($confDir)) {
mkdir($confDir, 0777, true);
}
file_put_contents(CMF_ROOT . 'data/conf/database.php', $conf);
} catch (\Exception $e) {
return false;
}
return true;
}
}
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
return [];
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\install\controller;
use app\admin\model\ThemeModel;
use think\Controller;
use think\Db;
class IndexController extends Controller
{
public function _initialize()
{
if (cmf_is_installed()) {
$this->error('网站已经安装', cmf_get_root() . '/');
}
}
// 安装首页
public function index()
{
return $this->fetch(":index");
}
public function step2()
{
// if (file_exists_case('data/conf/config.php')) {
// @unlink('data/conf/config.php');
// }
$data = [];
$data['phpversion'] = @phpversion();
$data['os'] = PHP_OS;
$tmp = function_exists('gd_info') ? gd_info() : [];
// $server = $_SERVER["SERVER_SOFTWARE"];
// $host = $this->request->host();
// $name = $_SERVER["SERVER_NAME"];
// $max_execution_time = ini_get('max_execution_time');
// $allow_reference = (ini_get('allow_call_time_pass_reference') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');
// $allow_url_fopen = (ini_get('allow_url_fopen') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');
// $safe_mode = (ini_get('safe_mode') ? '<font color=red>[×]On</font>' : '<font color=green>[√]Off</font>');
$err = 0;
if (empty($tmp['GD Version'])) {
$gd = '<font color=red>[×]Off</font>';
$err++;
} else {
$gd = '<font color=green>[√]On</font> ' . $tmp['GD Version'];
}
if (class_exists('pdo')) {
$data['pdo'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['pdo'] = '<i class="fa fa-remove error"></i> 未开启';
$err++;
}
if (extension_loaded('pdo_mysql')) {
$data['pdo_mysql'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['pdo_mysql'] = '<i class="fa fa-remove error"></i> 未开启';
$err++;
}
if (extension_loaded('curl')) {
$data['curl'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['curl'] = '<i class="fa fa-remove error"></i> 未开启';
$err++;
}
if (extension_loaded('gd')) {
$data['gd'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['gd'] = '<i class="fa fa-remove error"></i> 未开启';
if (function_exists('imagettftext')) {
$data['gd'] .= '<br><i class="fa fa-remove error"></i> FreeType Support未开启';
}
$err++;
}
if (extension_loaded('mbstring')) {
$data['mbstring'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['mbstring'] = '<i class="fa fa-remove error"></i> 未开启';
if (function_exists('imagettftext')) {
$data['mbstring'] .= '<br><i class="fa fa-remove error"></i> FreeType Support未开启';
}
$err++;
}
if (extension_loaded('fileinfo')) {
$data['fileinfo'] = '<i class="fa fa-check correct"></i> 已开启';
} else {
$data['fileinfo'] = '<i class="fa fa-remove error"></i> 未开启';
$err++;
}
if (ini_get('file_uploads')) {
$data['upload_size'] = '<i class="fa fa-check correct"></i> ' . ini_get('upload_max_filesize');
} else {
$data['upload_size'] = '<i class="fa fa-remove error"></i> 禁止上传';
}
if (function_exists('session_start')) {
$data['session'] = '<i class="fa fa-check correct"></i> 支持';
} else {
$data['session'] = '<i class="fa fa-remove error"></i> 不支持';
$err++;
}
if (version_compare(phpversion(), '5.6.0', '>=') && version_compare(phpversion(), '7.0.0', '<') && ini_get('always_populate_raw_post_data') != -1) {
$data['always_populate_raw_post_data'] = '<i class="fa fa-remove error"></i> 未关闭';
$data['show_always_populate_raw_post_data_tip'] = true;
$err++;
} else {
$data['always_populate_raw_post_data'] = '<i class="fa fa-check correct"></i> 已关闭';
}
$folders = [
realpath(CMF_ROOT . 'data') . DS,
realpath('./upload') . DS,
];
$newFolders = [];
foreach ($folders as $dir) {
$testDir = $dir;
sp_dir_create($testDir);
if (sp_testwrite($testDir)) {
$newFolders[$dir]['w'] = true;
} else {
$newFolders[$dir]['w'] = false;
$err++;
}
if (is_readable($testDir)) {
$newFolders[$dir]['r'] = true;
} else {
$newFolders[$dir]['r'] = false;
$err++;
}
}
$data['folders'] = $newFolders;
$this->assign($data);
return $this->fetch(":step2");
}
public function step3()
{
return $this->fetch(":step3");
}
public function step4()
{
session(null);
if ($this->request->isPost()) {
//创建数据库
$dbConfig = [];
$dbConfig['type'] = "mysql";
$dbConfig['hostname'] = $this->request->param('dbhost');
$dbConfig['username'] = $this->request->param('dbuser');
$dbConfig['password'] = $this->request->param('dbpw');
$dbConfig['hostport'] = $this->request->param('dbport');
$dbConfig['charset'] = $this->request->param('dbcharset', 'utf8mb4');
$userLogin = $this->request->param('manager');
$userPass = $this->request->param('manager_pwd');
$userEmail = $this->request->param('manager_email');
//检查密码。空 6-32字符。
empty($userPass) && $this->error("密码不可以为空");
strlen($userPass) < 6 && $this->error("密码长度最少6位");
strlen($userPass) > 32 && $this->error("密码长度最多32位");
$db = Db::connect($dbConfig);
$dbName = $this->request->param('dbname');
$sql = "CREATE DATABASE IF NOT EXISTS `{$dbName}` DEFAULT CHARACTER SET " . $dbConfig['charset'];
$db->execute($sql) || $this->error($db->getError());
$dbConfig['database'] = $dbName;
$dbConfig['prefix'] = $this->request->param('dbprefix', '', 'trim');
session('install.db_config', $dbConfig);
$sql = cmf_split_sql(APP_PATH . 'install/data/thinkcmf.sql', $dbConfig['prefix'], $dbConfig['charset']);
session('install.sql', $sql);
$this->assign('sql_count', count($sql));
session('install.error', 0);
$siteName = $this->request->param('sitename');
$seoKeywords = $this->request->param('sitekeywords');
$siteInfo = $this->request->param('siteinfo');
session('install.site_info', [
'site_name' => $siteName,
'site_seo_title' => $siteName,
'site_seo_keywords' => $seoKeywords,
'site_seo_description' => $siteInfo
]);
session('install.admin_info', [
'user_login' => $userLogin,
'user_pass' => $userPass,
'user_email' => $userEmail
]);
return $this->fetch(":step4");
} else {
exit;
}
}
public function install()
{
$dbConfig = session('install.db_config');
$sql = session('install.sql');
if (empty($dbConfig) || empty($sql)) {
$this->error("非法安装!");
}
$sqlIndex = $this->request->param('sql_index', 0, 'intval');
$db = Db::connect($dbConfig);
if ($sqlIndex >= count($sql)) {
$installError = session('install.error');
$this->success("安装完成!", '', ['done' => 1, 'error' => $installError]);
}
$sqlToExec = $sql[$sqlIndex] . ';';
$result = sp_execute_sql($db, $sqlToExec);
if (!empty($result['error'])) {
$installError = session('install.error');
$installError = empty($installError) ? 0 : $installError;
session('install.error', $installError + 1);
$this->error($result['message'], '', [
'sql' => $sqlToExec,
'exception' => $result['exception']
]);
} else {
$this->success($result['message'], '', [
'sql' => $sqlToExec
]);
}
}
public function setDbConfig()
{
$dbConfig = session('install.db_config');
$dbConfig['authcode'] = cmf_random_string(18);
$result = sp_create_db_config($dbConfig);
if ($result) {
$this->success("数据配置文件写入成功!");
} else {
$this->error("数据配置文件写入失败!");
}
}
public function setSite()
{
$dbConfig = session('install.db_config');
if (empty($dbConfig)) {
$this->error("非法安装!");
}
$siteInfo = session('install.site_info');
$admin = session('install.admin_info');
$admin['id'] = 1;
$admin['user_pass'] = cmf_password($admin['user_pass']);
$admin['user_type'] = 1;
$admin['create_time'] = time();
$admin['user_status'] = 1;
$admin['user_nickname'] = $admin['user_login'];
try {
cmf_set_option('site_info', $siteInfo);
Db::name('user')->insert($admin);
} catch (\Exception $e) {
$this->error("网站创建失败!");
}
$this->success("网站创建完成!");
}
public function installTheme()
{
$themeModel = new ThemeModel();
$result = $themeModel->installTheme(config('cmf_default_theme'));
if ($result === false) {
$this->error('模板不存在!');
}
session("install.step", 4);
$this->success("模板安装成功");
}
public function step5()
{
if (session("install.step") == 4) {
@touch(CMF_ROOT . 'data/install.lock');
return $this->fetch(":step5");
} else {
$this->error("非法安装!");
}
}
public function testDbPwd()
{
if ($this->request->isPost()) {
$dbConfig = $this->request->param();
$dbConfig['type'] = "mysql";
$supportInnoDb = false;
try {
Db::connect($dbConfig)->query("SELECT VERSION();");
$engines = Db::connect($dbConfig)->query("SHOW ENGINES;");
foreach ($engines as $engine) {
if ($engine['Engine'] == 'InnoDB' && $engine['Support'] != 'NO') {
$supportInnoDb = true;
break;
}
}
} catch (\Exception $e) {
$this->error('数据库账号或密码不正确!');
}
if($supportInnoDb){
$this->success('验证成功!');
}else{
$this->error('数据库账号密码验证通过,但不支持InnoDb!');
}
} else {
$this->error('非法请求方式!');
}
}
public function testRewrite()
{
$this->success('success');
}
}
<?php
/**
* 配置文件
*/
return [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '#hostname#',
// 数据库名
'database' => '#database#',
// 用户名
'username' => '#username#',
// 密码
'password' => '#password#',
// 端口
'hostport' => '#hostport#',
// 数据库编码默认采用utf8
'charset' => '#charset#',
// 数据库表前缀
'prefix' => '#prefix#',
"authcode" => '#authcode#',
//#COOKIE_PREFIX#
];
--
-- 表的结构 `cmf_admin_menu`
--
CREATE TABLE IF NOT EXISTS `cmf_admin_menu` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父菜单id',
`type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '菜单类型;1:有界面可访问菜单,2:无界面可访问菜单,0:只作为菜单',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '状态;1:显示,0:不显示',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`app` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '应用名',
`controller` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '控制器名',
`action` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '操作名称',
`param` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '额外参数',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
`icon` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '菜单图标',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`),
KEY `status` (`status`),
KEY `parent_id` (`parent_id`),
KEY `controller` (`controller`)
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COMMENT='后台菜单表';
--
-- 转存表中的数据 `cmf_admin_menu`
--
INSERT INTO `cmf_admin_menu` (`id`, `parent_id`, `type`, `status`, `list_order`, `app`, `controller`, `action`, `param`, `name`, `icon`, `remark`) VALUES
(1, 0, 0, 1, 20, 'admin', 'Plugin', 'default', '', '插件中心', 'cloud', '插件中心'),
(2, 1, 1, 1, 10000, 'admin', 'Hook', 'index', '', '钩子管理', '', '钩子管理'),
(3, 2, 1, 0, 10000, 'admin', 'Hook', 'plugins', '', '钩子插件管理', '', '钩子插件管理'),
(4, 2, 2, 0, 10000, 'admin', 'Hook', 'pluginListOrder', '', '钩子插件排序', '', '钩子插件排序'),
(5, 2, 1, 0, 10000, 'admin', 'Hook', 'sync', '', '同步钩子', '', '同步钩子'),
(6, 0, 0, 1, 0, 'admin', 'Setting', 'default', '', '设置', 'cogs', '系统设置入口'),
(7, 6, 1, 1, 50, 'admin', 'Link', 'index', '', '友情链接', '', '友情链接管理'),
(8, 7, 1, 0, 10000, 'admin', 'Link', 'add', '', '添加友情链接', '', '添加友情链接'),
(9, 7, 2, 0, 10000, 'admin', 'Link', 'addPost', '', '添加友情链接提交保存', '', '添加友情链接提交保存'),
(10, 7, 1, 0, 10000, 'admin', 'Link', 'edit', '', '编辑友情链接', '', '编辑友情链接'),
(11, 7, 2, 0, 10000, 'admin', 'Link', 'editPost', '', '编辑友情链接提交保存', '', '编辑友情链接提交保存'),
(12, 7, 2, 0, 10000, 'admin', 'Link', 'delete', '', '删除友情链接', '', '删除友情链接'),
(13, 7, 2, 0, 10000, 'admin', 'Link', 'listOrder', '', '友情链接排序', '', '友情链接排序'),
(14, 7, 2, 0, 10000, 'admin', 'Link', 'toggle', '', '友情链接显示隐藏', '', '友情链接显示隐藏'),
(15, 6, 1, 1, 10, 'admin', 'Mailer', 'index', '', '邮箱配置', '', '邮箱配置'),
(16, 15, 2, 0, 10000, 'admin', 'Mailer', 'indexPost', '', '邮箱配置提交保存', '', '邮箱配置提交保存'),
(17, 15, 1, 0, 10000, 'admin', 'Mailer', 'template', '', '邮件模板', '', '邮件模板'),
(18, 15, 2, 0, 10000, 'admin', 'Mailer', 'templatePost', '', '邮件模板提交', '', '邮件模板提交'),
(19, 15, 1, 0, 10000, 'admin', 'Mailer', 'test', '', '邮件发送测试', '', '邮件发送测试'),
(20, 6, 1, 0, 10000, 'admin', 'Menu', 'index', '', '后台菜单', '', '后台菜单管理'),
(21, 20, 1, 0, 10000, 'admin', 'Menu', 'lists', '', '所有菜单', '', '后台所有菜单列表'),
(22, 20, 1, 0, 10000, 'admin', 'Menu', 'add', '', '后台菜单添加', '', '后台菜单添加'),
(23, 20, 2, 0, 10000, 'admin', 'Menu', 'addPost', '', '后台菜单添加提交保存', '', '后台菜单添加提交保存'),
(24, 20, 1, 0, 10000, 'admin', 'Menu', 'edit', '', '后台菜单编辑', '', '后台菜单编辑'),
(25, 20, 2, 0, 10000, 'admin', 'Menu', 'editPost', '', '后台菜单编辑提交保存', '', '后台菜单编辑提交保存'),
(26, 20, 2, 0, 10000, 'admin', 'Menu', 'delete', '', '后台菜单删除', '', '后台菜单删除'),
(27, 20, 2, 0, 10000, 'admin', 'Menu', 'listOrder', '', '后台菜单排序', '', '后台菜单排序'),
(28, 20, 1, 0, 10000, 'admin', 'Menu', 'getActions', '', '导入新后台菜单', '', '导入新后台菜单'),
(29, 6, 1, 1, 30, 'admin', 'Nav', 'index', '', '导航管理', '', '导航管理'),
(30, 29, 1, 0, 10000, 'admin', 'Nav', 'add', '', '添加导航', '', '添加导航'),
(31, 29, 2, 0, 10000, 'admin', 'Nav', 'addPost', '', '添加导航提交保存', '', '添加导航提交保存'),
(32, 29, 1, 0, 10000, 'admin', 'Nav', 'edit', '', '编辑导航', '', '编辑导航'),
(33, 29, 2, 0, 10000, 'admin', 'Nav', 'editPost', '', '编辑导航提交保存', '', '编辑导航提交保存'),
(34, 29, 2, 0, 10000, 'admin', 'Nav', 'delete', '', '删除导航', '', '删除导航'),
(35, 29, 1, 0, 10000, 'admin', 'NavMenu', 'index', '', '导航菜单', '', '导航菜单'),
(36, 35, 1, 0, 10000, 'admin', 'NavMenu', 'add', '', '添加导航菜单', '', '添加导航菜单'),
(37, 35, 2, 0, 10000, 'admin', 'NavMenu', 'addPost', '', '添加导航菜单提交保存', '', '添加导航菜单提交保存'),
(38, 35, 1, 0, 10000, 'admin', 'NavMenu', 'edit', '', '编辑导航菜单', '', '编辑导航菜单'),
(39, 35, 2, 0, 10000, 'admin', 'NavMenu', 'editPost', '', '编辑导航菜单提交保存', '', '编辑导航菜单提交保存'),
(40, 35, 2, 0, 10000, 'admin', 'NavMenu', 'delete', '', '删除导航菜单', '', '删除导航菜单'),
(41, 35, 2, 0, 10000, 'admin', 'NavMenu', 'listOrder', '', '导航菜单排序', '', '导航菜单排序'),
(42, 1, 1, 1, 10000, 'admin', 'Plugin', 'index', '', '插件列表', '', '插件列表'),
(43, 42, 2, 0, 10000, 'admin', 'Plugin', 'toggle', '', '插件启用禁用', '', '插件启用禁用'),
(44, 42, 1, 0, 10000, 'admin', 'Plugin', 'setting', '', '插件设置', '', '插件设置'),
(45, 42, 2, 0, 10000, 'admin', 'Plugin', 'settingPost', '', '插件设置提交', '', '插件设置提交'),
(46, 42, 2, 0, 10000, 'admin', 'Plugin', 'install', '', '插件安装', '', '插件安装'),
(47, 42, 2, 0, 10000, 'admin', 'Plugin', 'update', '', '插件更新', '', '插件更新'),
(48, 42, 2, 0, 10000, 'admin', 'Plugin', 'uninstall', '', '卸载插件', '', '卸载插件'),
(49, 109, 0, 1, 10000, 'admin', 'User', 'default', '', '管理组', '', '管理组'),
(50, 49, 1, 1, 10000, 'admin', 'Rbac', 'index', '', '角色管理', '', '角色管理'),
(51, 50, 1, 0, 10000, 'admin', 'Rbac', 'roleAdd', '', '添加角色', '', '添加角色'),
(52, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleAddPost', '', '添加角色提交', '', '添加角色提交'),
(53, 50, 1, 0, 10000, 'admin', 'Rbac', 'roleEdit', '', '编辑角色', '', '编辑角色'),
(54, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleEditPost', '', '编辑角色提交', '', '编辑角色提交'),
(55, 50, 2, 0, 10000, 'admin', 'Rbac', 'roleDelete', '', '删除角色', '', '删除角色'),
(56, 50, 1, 0, 10000, 'admin', 'Rbac', 'authorize', '', '设置角色权限', '', '设置角色权限'),
(57, 50, 2, 0, 10000, 'admin', 'Rbac', 'authorizePost', '', '角色授权提交', '', '角色授权提交'),
(58, 0, 1, 0, 10000, 'admin', 'RecycleBin', 'index', '', '回收站', '', '回收站'),
(59, 58, 2, 0, 10000, 'admin', 'RecycleBin', 'restore', '', '回收站还原', '', '回收站还原'),
(60, 58, 2, 0, 10000, 'admin', 'RecycleBin', 'delete', '', '回收站彻底删除', '', '回收站彻底删除'),
(61, 6, 1, 1, 10000, 'admin', 'Route', 'index', '', 'URL美化', '', 'URL规则管理'),
(62, 61, 1, 0, 10000, 'admin', 'Route', 'add', '', '添加路由规则', '', '添加路由规则'),
(63, 61, 2, 0, 10000, 'admin', 'Route', 'addPost', '', '添加路由规则提交', '', '添加路由规则提交'),
(64, 61, 1, 0, 10000, 'admin', 'Route', 'edit', '', '路由规则编辑', '', '路由规则编辑'),
(65, 61, 2, 0, 10000, 'admin', 'Route', 'editPost', '', '路由规则编辑提交', '', '路由规则编辑提交'),
(66, 61, 2, 0, 10000, 'admin', 'Route', 'delete', '', '路由规则删除', '', '路由规则删除'),
(67, 61, 2, 0, 10000, 'admin', 'Route', 'ban', '', '路由规则禁用', '', '路由规则禁用'),
(68, 61, 2, 0, 10000, 'admin', 'Route', 'open', '', '路由规则启用', '', '路由规则启用'),
(69, 61, 2, 0, 10000, 'admin', 'Route', 'listOrder', '', '路由规则排序', '', '路由规则排序'),
(70, 61, 1, 0, 10000, 'admin', 'Route', 'select', '', '选择URL', '', '选择URL'),
(71, 6, 1, 1, 0, 'admin', 'Setting', 'site', '', '网站信息', '', '网站信息'),
(72, 71, 2, 0, 10000, 'admin', 'Setting', 'sitePost', '', '网站信息设置提交', '', '网站信息设置提交'),
(73, 6, 1, 0, 10000, 'admin', 'Setting', 'password', '', '密码修改', '', '密码修改'),
(74, 73, 2, 0, 10000, 'admin', 'Setting', 'passwordPost', '', '密码修改提交', '', '密码修改提交'),
(75, 6, 1, 1, 10000, 'admin', 'Setting', 'upload', '', '上传设置', '', '上传设置'),
(76, 75, 2, 0, 10000, 'admin', 'Setting', 'uploadPost', '', '上传设置提交', '', '上传设置提交'),
(77, 6, 1, 0, 10000, 'admin', 'Setting', 'clearCache', '', '清除缓存', '', '清除缓存'),
(78, 6, 1, 1, 40, 'admin', 'Slide', 'index', '', '幻灯片管理', '', '幻灯片管理'),
(79, 78, 1, 0, 10000, 'admin', 'Slide', 'add', '', '添加幻灯片', '', '添加幻灯片'),
(80, 78, 2, 0, 10000, 'admin', 'Slide', 'addPost', '', '添加幻灯片提交', '', '添加幻灯片提交'),
(81, 78, 1, 0, 10000, 'admin', 'Slide', 'edit', '', '编辑幻灯片', '', '编辑幻灯片'),
(82, 78, 2, 0, 10000, 'admin', 'Slide', 'editPost', '', '编辑幻灯片提交', '', '编辑幻灯片提交'),
(83, 78, 2, 0, 10000, 'admin', 'Slide', 'delete', '', '删除幻灯片', '', '删除幻灯片'),
(84, 78, 1, 0, 10000, 'admin', 'SlideItem', 'index', '', '幻灯片页面列表', '', '幻灯片页面列表'),
(85, 84, 1, 0, 10000, 'admin', 'SlideItem', 'add', '', '幻灯片页面添加', '', '幻灯片页面添加'),
(86, 84, 2, 0, 10000, 'admin', 'SlideItem', 'addPost', '', '幻灯片页面添加提交', '', '幻灯片页面添加提交'),
(87, 84, 1, 0, 10000, 'admin', 'SlideItem', 'edit', '', '幻灯片页面编辑', '', '幻灯片页面编辑'),
(88, 84, 2, 0, 10000, 'admin', 'SlideItem', 'editPost', '', '幻灯片页面编辑提交', '', '幻灯片页面编辑提交'),
(89, 84, 2, 0, 10000, 'admin', 'SlideItem', 'delete', '', '幻灯片页面删除', '', '幻灯片页面删除'),
(90, 84, 2, 0, 10000, 'admin', 'SlideItem', 'ban', '', '幻灯片页面隐藏', '', '幻灯片页面隐藏'),
(91, 84, 2, 0, 10000, 'admin', 'SlideItem', 'cancelBan', '', '幻灯片页面显示', '', '幻灯片页面显示'),
(92, 84, 2, 0, 10000, 'admin', 'SlideItem', 'listOrder', '', '幻灯片页面排序', '', '幻灯片页面排序'),
(93, 6, 1, 1, 10000, 'admin', 'Storage', 'index', '', '文件存储', '', '文件存储'),
(94, 93, 2, 0, 10000, 'admin', 'Storage', 'settingPost', '', '文件存储设置提交', '', '文件存储设置提交'),
(95, 6, 1, 1, 20, 'admin', 'Theme', 'index', '', '模板管理', '', '模板管理'),
(96, 95, 1, 0, 10000, 'admin', 'Theme', 'install', '', '安装模板', '', '安装模板'),
(97, 95, 2, 0, 10000, 'admin', 'Theme', 'uninstall', '', '卸载模板', '', '卸载模板'),
(98, 95, 2, 0, 10000, 'admin', 'Theme', 'installTheme', '', '模板安装', '', '模板安装'),
(99, 95, 2, 0, 10000, 'admin', 'Theme', 'update', '', '模板更新', '', '模板更新'),
(100, 95, 2, 0, 10000, 'admin', 'Theme', 'active', '', '启用模板', '', '启用模板'),
(101, 95, 1, 0, 10000, 'admin', 'Theme', 'files', '', '模板文件列表', '', '启用模板'),
(102, 95, 1, 0, 10000, 'admin', 'Theme', 'fileSetting', '', '模板文件设置', '', '模板文件设置'),
(103, 95, 1, 0, 10000, 'admin', 'Theme', 'fileArrayData', '', '模板文件数组数据列表', '', '模板文件数组数据列表'),
(104, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataEdit', '', '模板文件数组数据添加编辑', '', '模板文件数组数据添加编辑'),
(105, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataEditPost', '', '模板文件数组数据添加编辑提交保存', '', '模板文件数组数据添加编辑提交保存'),
(106, 95, 2, 0, 10000, 'admin', 'Theme', 'fileArrayDataDelete', '', '模板文件数组数据删除', '', '模板文件数组数据删除'),
(107, 95, 2, 0, 10000, 'admin', 'Theme', 'settingPost', '', '模板文件编辑提交保存', '', '模板文件编辑提交保存'),
(108, 95, 1, 0, 10000, 'admin', 'Theme', 'dataSource', '', '模板文件设置数据源', '', '模板文件设置数据源'),
(109, 0, 0, 1, 10, 'user', 'AdminIndex', 'default', '', '用户管理', 'group', '用户管理'),
(110, 49, 1, 1, 10000, 'admin', 'User', 'index', '', '管理员', '', '管理员管理'),
(111, 110, 1, 0, 10000, 'admin', 'User', 'add', '', '管理员添加', '', '管理员添加'),
(112, 110, 2, 0, 10000, 'admin', 'User', 'addPost', '', '管理员添加提交', '', '管理员添加提交'),
(113, 110, 1, 0, 10000, 'admin', 'User', 'edit', '', '管理员编辑', '', '管理员编辑'),
(114, 110, 2, 0, 10000, 'admin', 'User', 'editPost', '', '管理员编辑提交', '', '管理员编辑提交'),
(115, 110, 1, 0, 10000, 'admin', 'User', 'userInfo', '', '个人信息', '', '管理员个人信息修改'),
(116, 110, 2, 0, 10000, 'admin', 'User', 'userInfoPost', '', '管理员个人信息修改提交', '', '管理员个人信息修改提交'),
(117, 110, 2, 0, 10000, 'admin', 'User', 'delete', '', '管理员删除', '', '管理员删除'),
(118, 110, 2, 0, 10000, 'admin', 'User', 'ban', '', '停用管理员', '', '停用管理员'),
(119, 110, 2, 0, 10000, 'admin', 'User', 'cancelBan', '', '启用管理员', '', '启用管理员'),
(120, 0, 0, 1, 30, 'portal', 'AdminIndex', 'default', '', '门户管理', 'th', '门户管理'),
(121, 120, 1, 1, 10000, 'portal', 'AdminArticle', 'index', '', '文章管理', '', '文章列表'),
(122, 121, 1, 0, 10000, 'portal', 'AdminArticle', 'add', '', '添加文章', '', '添加文章'),
(123, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'addPost', '', '添加文章提交', '', '添加文章提交'),
(124, 121, 1, 0, 10000, 'portal', 'AdminArticle', 'edit', '', '编辑文章', '', '编辑文章'),
(125, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'editPost', '', '编辑文章提交', '', '编辑文章提交'),
(126, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'delete', '', '文章删除', '', '文章删除'),
(127, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'publish', '', '文章发布', '', '文章发布'),
(128, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'top', '', '文章置顶', '', '文章置顶'),
(129, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'recommend', '', '文章推荐', '', '文章推荐'),
(130, 121, 2, 0, 10000, 'portal', 'AdminArticle', 'listOrder', '', '文章排序', '', '文章排序'),
(131, 120, 1, 1, 10000, 'portal', 'AdminCategory', 'index', '', '分类管理', '', '文章分类列表'),
(132, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'add', '', '添加文章分类', '', '添加文章分类'),
(133, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'addPost', '', '添加文章分类提交', '', '添加文章分类提交'),
(134, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'edit', '', '编辑文章分类', '', '编辑文章分类'),
(135, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'editPost', '', '编辑文章分类提交', '', '编辑文章分类提交'),
(136, 131, 1, 0, 10000, 'portal', 'AdminCategory', 'select', '', '文章分类选择对话框', '', '文章分类选择对话框'),
(137, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'listOrder', '', '文章分类排序', '', '文章分类排序'),
(138, 131, 2, 0, 10000, 'portal', 'AdminCategory', 'delete', '', '删除文章分类', '', '删除文章分类'),
(139, 120, 1, 1, 10000, 'portal', 'AdminPage', 'index', '', '页面管理', '', '页面管理'),
(140, 139, 1, 0, 10000, 'portal', 'AdminPage', 'add', '', '添加页面', '', '添加页面'),
(141, 139, 2, 0, 10000, 'portal', 'AdminPage', 'addPost', '', '添加页面提交', '', '添加页面提交'),
(142, 139, 1, 0, 10000, 'portal', 'AdminPage', 'edit', '', '编辑页面', '', '编辑页面'),
(143, 139, 2, 0, 10000, 'portal', 'AdminPage', 'editPost', '', '编辑页面提交', '', '编辑页面提交'),
(144, 139, 2, 0, 10000, 'portal', 'AdminPage', 'delete', '', '删除页面', '', '删除页面'),
(145, 120, 1, 1, 10000, 'portal', 'AdminTag', 'index', '', '文章标签', '', '文章标签'),
(146, 145, 1, 0, 10000, 'portal', 'AdminTag', 'add', '', '添加文章标签', '', '添加文章标签'),
(147, 145, 2, 0, 10000, 'portal', 'AdminTag', 'addPost', '', '添加文章标签提交', '', '添加文章标签提交'),
(148, 145, 2, 0, 10000, 'portal', 'AdminTag', 'upStatus', '', '更新标签状态', '', '更新标签状态'),
(149, 145, 2, 0, 10000, 'portal', 'AdminTag', 'delete', '', '删除文章标签', '', '删除文章标签'),
(150, 0, 1, 0, 10000, 'user', 'AdminAsset', 'index', '', '资源管理', 'file', '资源管理列表'),
(151, 150, 2, 0, 10000, 'user', 'AdminAsset', 'delete', '', '删除文件', '', '删除文件'),
(152, 109, 0, 1, 10000, 'user', 'AdminIndex', 'default1', '', '用户组', '', '用户组'),
(153, 152, 1, 1, 10000, 'user', 'AdminIndex', 'index', '', '本站用户', '', '本站用户'),
(154, 153, 2, 0, 10000, 'user', 'AdminIndex', 'ban', '', '本站用户拉黑', '', '本站用户拉黑'),
(155, 153, 2, 0, 10000, 'user', 'AdminIndex', 'cancelBan', '', '本站用户启用', '', '本站用户启用'),
(156, 152, 1, 1, 10000, 'user', 'AdminOauth', 'index', '', '第三方用户', '', '第三方用户'),
(157, 156, 2, 0, 10000, 'user', 'AdminOauth', 'delete', '', '删除第三方用户绑定', '', '删除第三方用户绑定'),
(158, 6, 1, 1, 10000, 'user', 'AdminUserAction', 'index', '', '用户操作管理', '', '用户操作管理'),
(159, 158, 1, 0, 10000, 'user', 'AdminUserAction', 'edit', '', '编辑用户操作', '', '编辑用户操作'),
(160, 158, 2, 0, 10000, 'user', 'AdminUserAction', 'editPost', '', '编辑用户操作提交', '', '编辑用户操作提交'),
(161, 158, 1, 0, 10000, 'user', 'AdminUserAction', 'sync', '', '同步用户操作', '', '同步用户操作');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_asset`
--
CREATE TABLE IF NOT EXISTS `cmf_asset` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',
`file_size` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文件大小,单位B',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传时间',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:可用,0:不可用',
`download_times` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载次数',
`file_key` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件惟一码',
`filename` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文件名',
`file_path` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件路径,相对于upload目录,可以为url',
`file_md5` varchar(32) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '文件md5值',
`file_sha1` varchar(40) CHARACTER SET utf8 NOT NULL DEFAULT '',
`suffix` varchar(10) NOT NULL DEFAULT '' COMMENT '文件后缀名,不包括点',
`more` text COMMENT '其它详细信息,JSON格式',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='资源表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_auth_access`
--
CREATE TABLE IF NOT EXISTS `cmf_auth_access` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`role_id` int(10) UNSIGNED NOT NULL COMMENT '角色',
`rule_name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',
`type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类,请加应用前缀,如admin_',
PRIMARY KEY (`id`),
KEY `role_id` (`role_id`),
KEY `rule_name` (`rule_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限授权表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_auth_rule`
--
CREATE TABLE IF NOT EXISTS `cmf_auth_rule` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '规则id,自增主键',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否有效(0:无效,1:有效)',
`app` varchar(15) NOT NULL COMMENT '规则所属module',
`type` varchar(30) NOT NULL DEFAULT '' COMMENT '权限规则分类,请加应用前缀,如admin_',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则唯一英文标识,全小写',
`param` varchar(100) NOT NULL DEFAULT '' COMMENT '额外url参数',
`title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '规则描述',
`condition` varchar(200) NOT NULL DEFAULT '' COMMENT '规则附加条件',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`) USING BTREE,
KEY `module` (`app`,`status`,`type`)
) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=utf8mb4 COMMENT='权限规则表';
--
-- 转存表中的数据 `cmf_auth_rule`
--
INSERT INTO `cmf_auth_rule` (`id`, `status`, `app`, `type`, `name`, `param`, `title`, `condition`) VALUES
(1, 1, 'admin', 'admin_url', 'admin/Hook/index', '', '钩子管理', ''),
(2, 1, 'admin', 'admin_url', 'admin/Hook/plugins', '', '钩子插件管理', ''),
(3, 1, 'admin', 'admin_url', 'admin/Hook/pluginListOrder', '', '钩子插件排序', ''),
(4, 1, 'admin', 'admin_url', 'admin/Hook/sync', '', '同步钩子', ''),
(5, 1, 'admin', 'admin_url', 'admin/Link/index', '', '友情链接', ''),
(6, 1, 'admin', 'admin_url', 'admin/Link/add', '', '添加友情链接', ''),
(7, 1, 'admin', 'admin_url', 'admin/Link/addPost', '', '添加友情链接提交保存', ''),
(8, 1, 'admin', 'admin_url', 'admin/Link/edit', '', '编辑友情链接', ''),
(9, 1, 'admin', 'admin_url', 'admin/Link/editPost', '', '编辑友情链接提交保存', ''),
(10, 1, 'admin', 'admin_url', 'admin/Link/delete', '', '删除友情链接', ''),
(11, 1, 'admin', 'admin_url', 'admin/Link/listOrder', '', '友情链接排序', ''),
(12, 1, 'admin', 'admin_url', 'admin/Link/toggle', '', '友情链接显示隐藏', ''),
(13, 1, 'admin', 'admin_url', 'admin/Mailer/index', '', '邮箱配置', ''),
(14, 1, 'admin', 'admin_url', 'admin/Mailer/indexPost', '', '邮箱配置提交保存', ''),
(15, 1, 'admin', 'admin_url', 'admin/Mailer/template', '', '邮件模板', ''),
(16, 1, 'admin', 'admin_url', 'admin/Mailer/templatePost', '', '邮件模板提交', ''),
(17, 1, 'admin', 'admin_url', 'admin/Mailer/test', '', '邮件发送测试', ''),
(18, 1, 'admin', 'admin_url', 'admin/Menu/index', '', '后台菜单', ''),
(19, 1, 'admin', 'admin_url', 'admin/Menu/lists', '', '所有菜单', ''),
(20, 1, 'admin', 'admin_url', 'admin/Menu/add', '', '后台菜单添加', ''),
(21, 1, 'admin', 'admin_url', 'admin/Menu/addPost', '', '后台菜单添加提交保存', ''),
(22, 1, 'admin', 'admin_url', 'admin/Menu/edit', '', '后台菜单编辑', ''),
(23, 1, 'admin', 'admin_url', 'admin/Menu/editPost', '', '后台菜单编辑提交保存', ''),
(24, 1, 'admin', 'admin_url', 'admin/Menu/delete', '', '后台菜单删除', ''),
(25, 1, 'admin', 'admin_url', 'admin/Menu/listOrder', '', '后台菜单排序', ''),
(26, 1, 'admin', 'admin_url', 'admin/Menu/getActions', '', '导入新后台菜单', ''),
(27, 1, 'admin', 'admin_url', 'admin/Nav/index', '', '导航管理', ''),
(28, 1, 'admin', 'admin_url', 'admin/Nav/add', '', '添加导航', ''),
(29, 1, 'admin', 'admin_url', 'admin/Nav/addPost', '', '添加导航提交保存', ''),
(30, 1, 'admin', 'admin_url', 'admin/Nav/edit', '', '编辑导航', ''),
(31, 1, 'admin', 'admin_url', 'admin/Nav/editPost', '', '编辑导航提交保存', ''),
(32, 1, 'admin', 'admin_url', 'admin/Nav/delete', '', '删除导航', ''),
(33, 1, 'admin', 'admin_url', 'admin/NavMenu/index', '', '导航菜单', ''),
(34, 1, 'admin', 'admin_url', 'admin/NavMenu/add', '', '添加导航菜单', ''),
(35, 1, 'admin', 'admin_url', 'admin/NavMenu/addPost', '', '添加导航菜单提交保存', ''),
(36, 1, 'admin', 'admin_url', 'admin/NavMenu/edit', '', '编辑导航菜单', ''),
(37, 1, 'admin', 'admin_url', 'admin/NavMenu/editPost', '', '编辑导航菜单提交保存', ''),
(38, 1, 'admin', 'admin_url', 'admin/NavMenu/delete', '', '删除导航菜单', ''),
(39, 1, 'admin', 'admin_url', 'admin/NavMenu/listOrder', '', '导航菜单排序', ''),
(40, 1, 'admin', 'admin_url', 'admin/Plugin/default', '', '插件管理', ''),
(41, 1, 'admin', 'admin_url', 'admin/Plugin/index', '', '插件列表', ''),
(42, 1, 'admin', 'admin_url', 'admin/Plugin/toggle', '', '插件启用禁用', ''),
(43, 1, 'admin', 'admin_url', 'admin/Plugin/setting', '', '插件设置', ''),
(44, 1, 'admin', 'admin_url', 'admin/Plugin/settingPost', '', '插件设置提交', ''),
(45, 1, 'admin', 'admin_url', 'admin/Plugin/install', '', '插件安装', ''),
(46, 1, 'admin', 'admin_url', 'admin/Plugin/update', '', '插件更新', ''),
(47, 1, 'admin', 'admin_url', 'admin/Plugin/uninstall', '', '卸载插件', ''),
(48, 1, 'admin', 'admin_url', 'admin/Rbac/index', '', '角色管理', ''),
(49, 1, 'admin', 'admin_url', 'admin/Rbac/roleAdd', '', '添加角色', ''),
(50, 1, 'admin', 'admin_url', 'admin/Rbac/roleAddPost', '', '添加角色提交', ''),
(51, 1, 'admin', 'admin_url', 'admin/Rbac/roleEdit', '', '编辑角色', ''),
(52, 1, 'admin', 'admin_url', 'admin/Rbac/roleEditPost', '', '编辑角色提交', ''),
(53, 1, 'admin', 'admin_url', 'admin/Rbac/roleDelete', '', '删除角色', ''),
(54, 1, 'admin', 'admin_url', 'admin/Rbac/authorize', '', '设置角色权限', ''),
(55, 1, 'admin', 'admin_url', 'admin/Rbac/authorizePost', '', '角色授权提交', ''),
(56, 1, 'admin', 'admin_url', 'admin/RecycleBin/index', '', '回收站', ''),
(57, 1, 'admin', 'admin_url', 'admin/RecycleBin/restore', '', '回收站还原', ''),
(58, 1, 'admin', 'admin_url', 'admin/RecycleBin/delete', '', '回收站彻底删除', ''),
(59, 1, 'admin', 'admin_url', 'admin/Route/index', '', 'URL美化', ''),
(60, 1, 'admin', 'admin_url', 'admin/Route/add', '', '添加路由规则', ''),
(61, 1, 'admin', 'admin_url', 'admin/Route/addPost', '', '添加路由规则提交', ''),
(62, 1, 'admin', 'admin_url', 'admin/Route/edit', '', '路由规则编辑', ''),
(63, 1, 'admin', 'admin_url', 'admin/Route/editPost', '', '路由规则编辑提交', ''),
(64, 1, 'admin', 'admin_url', 'admin/Route/delete', '', '路由规则删除', ''),
(65, 1, 'admin', 'admin_url', 'admin/Route/ban', '', '路由规则禁用', ''),
(66, 1, 'admin', 'admin_url', 'admin/Route/open', '', '路由规则启用', ''),
(67, 1, 'admin', 'admin_url', 'admin/Route/listOrder', '', '路由规则排序', ''),
(68, 1, 'admin', 'admin_url', 'admin/Route/select', '', '选择URL', ''),
(69, 1, 'admin', 'admin_url', 'admin/Setting/default', '', '设置', ''),
(70, 1, 'admin', 'admin_url', 'admin/Setting/site', '', '网站信息', ''),
(71, 1, 'admin', 'admin_url', 'admin/Setting/sitePost', '', '网站信息设置提交', ''),
(72, 1, 'admin', 'admin_url', 'admin/Setting/password', '', '密码修改', ''),
(73, 1, 'admin', 'admin_url', 'admin/Setting/passwordPost', '', '密码修改提交', ''),
(74, 1, 'admin', 'admin_url', 'admin/Setting/upload', '', '上传设置', ''),
(75, 1, 'admin', 'admin_url', 'admin/Setting/uploadPost', '', '上传设置提交', ''),
(76, 1, 'admin', 'admin_url', 'admin/Setting/clearCache', '', '清除缓存', ''),
(77, 1, 'admin', 'admin_url', 'admin/Slide/index', '', '幻灯片管理', ''),
(78, 1, 'admin', 'admin_url', 'admin/Slide/add', '', '添加幻灯片', ''),
(79, 1, 'admin', 'admin_url', 'admin/Slide/addPost', '', '添加幻灯片提交', ''),
(80, 1, 'admin', 'admin_url', 'admin/Slide/edit', '', '编辑幻灯片', ''),
(81, 1, 'admin', 'admin_url', 'admin/Slide/editPost', '', '编辑幻灯片提交', ''),
(82, 1, 'admin', 'admin_url', 'admin/Slide/delete', '', '删除幻灯片', ''),
(83, 1, 'admin', 'admin_url', 'admin/SlideItem/index', '', '幻灯片页面列表', ''),
(84, 1, 'admin', 'admin_url', 'admin/SlideItem/add', '', '幻灯片页面添加', ''),
(85, 1, 'admin', 'admin_url', 'admin/SlideItem/addPost', '', '幻灯片页面添加提交', ''),
(86, 1, 'admin', 'admin_url', 'admin/SlideItem/edit', '', '幻灯片页面编辑', ''),
(87, 1, 'admin', 'admin_url', 'admin/SlideItem/editPost', '', '幻灯片页面编辑提交', ''),
(88, 1, 'admin', 'admin_url', 'admin/SlideItem/delete', '', '幻灯片页面删除', ''),
(89, 1, 'admin', 'admin_url', 'admin/SlideItem/ban', '', '幻灯片页面隐藏', ''),
(90, 1, 'admin', 'admin_url', 'admin/SlideItem/cancelBan', '', '幻灯片页面显示', ''),
(91, 1, 'admin', 'admin_url', 'admin/SlideItem/listOrder', '', '幻灯片页面排序', ''),
(92, 1, 'admin', 'admin_url', 'admin/Storage/index', '', '文件存储', ''),
(93, 1, 'admin', 'admin_url', 'admin/Storage/settingPost', '', '文件存储设置提交', ''),
(94, 1, 'admin', 'admin_url', 'admin/Theme/index', '', '模板管理', ''),
(95, 1, 'admin', 'admin_url', 'admin/Theme/install', '', '安装模板', ''),
(96, 1, 'admin', 'admin_url', 'admin/Theme/uninstall', '', '卸载模板', ''),
(97, 1, 'admin', 'admin_url', 'admin/Theme/installTheme', '', '模板安装', ''),
(98, 1, 'admin', 'admin_url', 'admin/Theme/update', '', '模板更新', ''),
(99, 1, 'admin', 'admin_url', 'admin/Theme/active', '', '启用模板', ''),
(100, 1, 'admin', 'admin_url', 'admin/Theme/files', '', '模板文件列表', ''),
(101, 1, 'admin', 'admin_url', 'admin/Theme/fileSetting', '', '模板文件设置', ''),
(102, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayData', '', '模板文件数组数据列表', ''),
(103, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataEdit', '', '模板文件数组数据添加编辑', ''),
(104, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataEditPost', '', '模板文件数组数据添加编辑提交保存', ''),
(105, 1, 'admin', 'admin_url', 'admin/Theme/fileArrayDataDelete', '', '模板文件数组数据删除', ''),
(106, 1, 'admin', 'admin_url', 'admin/Theme/settingPost', '', '模板文件编辑提交保存', ''),
(107, 1, 'admin', 'admin_url', 'admin/Theme/dataSource', '', '模板文件设置数据源', ''),
(108, 1, 'admin', 'admin_url', 'admin/User/default', '', '管理组', ''),
(109, 1, 'admin', 'admin_url', 'admin/User/index', '', '管理员', ''),
(110, 1, 'admin', 'admin_url', 'admin/User/add', '', '管理员添加', ''),
(111, 1, 'admin', 'admin_url', 'admin/User/addPost', '', '管理员添加提交', ''),
(112, 1, 'admin', 'admin_url', 'admin/User/edit', '', '管理员编辑', ''),
(113, 1, 'admin', 'admin_url', 'admin/User/editPost', '', '管理员编辑提交', ''),
(114, 1, 'admin', 'admin_url', 'admin/User/userInfo', '', '个人信息', ''),
(115, 1, 'admin', 'admin_url', 'admin/User/userInfoPost', '', '管理员个人信息修改提交', ''),
(116, 1, 'admin', 'admin_url', 'admin/User/delete', '', '管理员删除', ''),
(117, 1, 'admin', 'admin_url', 'admin/User/ban', '', '停用管理员', ''),
(118, 1, 'admin', 'admin_url', 'admin/User/cancelBan', '', '启用管理员', ''),
(119, 1, 'portal', 'admin_url', 'portal/AdminArticle/index', '', '文章管理', ''),
(120, 1, 'portal', 'admin_url', 'portal/AdminArticle/add', '', '添加文章', ''),
(121, 1, 'portal', 'admin_url', 'portal/AdminArticle/addPost', '', '添加文章提交', ''),
(122, 1, 'portal', 'admin_url', 'portal/AdminArticle/edit', '', '编辑文章', ''),
(123, 1, 'portal', 'admin_url', 'portal/AdminArticle/editPost', '', '编辑文章提交', ''),
(124, 1, 'portal', 'admin_url', 'portal/AdminArticle/delete', '', '文章删除', ''),
(125, 1, 'portal', 'admin_url', 'portal/AdminArticle/publish', '', '文章发布', ''),
(126, 1, 'portal', 'admin_url', 'portal/AdminArticle/top', '', '文章置顶', ''),
(127, 1, 'portal', 'admin_url', 'portal/AdminArticle/recommend', '', '文章推荐', ''),
(128, 1, 'portal', 'admin_url', 'portal/AdminArticle/listOrder', '', '文章排序', ''),
(129, 1, 'portal', 'admin_url', 'portal/AdminCategory/index', '', '分类管理', ''),
(130, 1, 'portal', 'admin_url', 'portal/AdminCategory/add', '', '添加文章分类', ''),
(131, 1, 'portal', 'admin_url', 'portal/AdminCategory/addPost', '', '添加文章分类提交', ''),
(132, 1, 'portal', 'admin_url', 'portal/AdminCategory/edit', '', '编辑文章分类', ''),
(133, 1, 'portal', 'admin_url', 'portal/AdminCategory/editPost', '', '编辑文章分类提交', ''),
(134, 1, 'portal', 'admin_url', 'portal/AdminCategory/select', '', '文章分类选择对话框', ''),
(135, 1, 'portal', 'admin_url', 'portal/AdminCategory/listOrder', '', '文章分类排序', ''),
(136, 1, 'portal', 'admin_url', 'portal/AdminCategory/delete', '', '删除文章分类', ''),
(137, 1, 'portal', 'admin_url', 'portal/AdminIndex/default', '', '门户管理', ''),
(138, 1, 'portal', 'admin_url', 'portal/AdminPage/index', '', '页面管理', ''),
(139, 1, 'portal', 'admin_url', 'portal/AdminPage/add', '', '添加页面', ''),
(140, 1, 'portal', 'admin_url', 'portal/AdminPage/addPost', '', '添加页面提交', ''),
(141, 1, 'portal', 'admin_url', 'portal/AdminPage/edit', '', '编辑页面', ''),
(142, 1, 'portal', 'admin_url', 'portal/AdminPage/editPost', '', '编辑页面提交', ''),
(143, 1, 'portal', 'admin_url', 'portal/AdminPage/delete', '', '删除页面', ''),
(144, 1, 'portal', 'admin_url', 'portal/AdminTag/index', '', '文章标签', ''),
(145, 1, 'portal', 'admin_url', 'portal/AdminTag/add', '', '添加文章标签', ''),
(146, 1, 'portal', 'admin_url', 'portal/AdminTag/addPost', '', '添加文章标签提交', ''),
(147, 1, 'portal', 'admin_url', 'portal/AdminTag/upStatus', '', '更新标签状态', ''),
(148, 1, 'portal', 'admin_url', 'portal/AdminTag/delete', '', '删除文章标签', ''),
(149, 1, 'user', 'admin_url', 'user/AdminAsset/index', '', '资源管理', ''),
(150, 1, 'user', 'admin_url', 'user/AdminAsset/delete', '', '删除文件', ''),
(151, 1, 'user', 'admin_url', 'user/AdminIndex/default', '', '用户管理', ''),
(152, 1, 'user', 'admin_url', 'user/AdminIndex/default1', '', '用户组', ''),
(153, 1, 'user', 'admin_url', 'user/AdminIndex/index', '', '本站用户', ''),
(154, 1, 'user', 'admin_url', 'user/AdminIndex/ban', '', '本站用户拉黑', ''),
(155, 1, 'user', 'admin_url', 'user/AdminIndex/cancelBan', '', '本站用户启用', ''),
(156, 1, 'user', 'admin_url', 'user/AdminOauth/index', '', '第三方用户', ''),
(157, 1, 'user', 'admin_url', 'user/AdminOauth/delete', '', '删除第三方用户绑定', ''),
(158, 1, 'user', 'admin_url', 'user/AdminUserAction/index', '', '用户操作管理', ''),
(159, 1, 'user', 'admin_url', 'user/AdminUserAction/edit', '', '编辑用户操作', ''),
(160, 1, 'user', 'admin_url', 'user/AdminUserAction/editPost', '', '编辑用户操作提交', ''),
(161, 1, 'user', 'admin_url', 'user/AdminUserAction/sync', '', '同步用户操作', '');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_comment`
--
CREATE TABLE IF NOT EXISTS `cmf_comment` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '被回复的评论id',
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发表评论的用户id',
`to_user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '被评论的用户id',
`object_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论内容 id',
`like_count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞数',
`dislike_count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '不喜欢数',
`floor` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '楼层数',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论时间',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:已审核,0:未审核',
`type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '评论类型;1实名评论',
`table_name` varchar(64) NOT NULL DEFAULT '' COMMENT '评论内容所在表,不带表前缀',
`full_name` varchar(50) NOT NULL DEFAULT '' COMMENT '评论者昵称',
`email` varchar(255) NOT NULL DEFAULT '' COMMENT '评论者邮箱',
`path` varchar(255) NOT NULL DEFAULT '' COMMENT '层级关系',
`url` text COMMENT '原文地址',
`content` text CHARACTER SET utf8mb4 COMMENT '评论内容',
`more` text CHARACTER SET utf8mb4 COMMENT '扩展属性',
PRIMARY KEY (`id`),
KEY `table_id_status` (`table_name`,`object_id`,`status`),
KEY `object_id` (`object_id`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `parent_id` (`parent_id`) USING BTREE,
KEY `create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评论表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_hook`
--
CREATE TABLE IF NOT EXISTS `cmf_hook` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '钩子类型(1:系统钩子;2:应用钩子;3:模板钩子;4:后台模板钩子)',
`once` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否只允许一个插件运行(0:多个;1:一个)',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子名称',
`hook` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子',
`app` varchar(15) NOT NULL DEFAULT '' COMMENT '应用名(只有应用钩子才用)',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='系统钩子表';
--
-- 转存表中的数据 `cmf_hook`
--
INSERT INTO `cmf_hook` (`id`, `type`, `once`, `name`, `hook`, `app`, `description`) VALUES
(1, 1, 0, '应用初始化', 'app_init', 'cmf', '应用初始化'),
(2, 1, 0, '应用开始', 'app_begin', 'cmf', '应用开始'),
(3, 1, 0, '模块初始化', 'module_init', 'cmf', '模块初始化'),
(4, 1, 0, '控制器开始', 'action_begin', 'cmf', '控制器开始'),
(5, 1, 0, '视图输出过滤', 'view_filter', 'cmf', '视图输出过滤'),
(6, 1, 0, '应用结束', 'app_end', 'cmf', '应用结束'),
(7, 1, 0, '日志write方法', 'log_write', 'cmf', '日志write方法'),
(8, 1, 0, '输出结束', 'response_end', 'cmf', '输出结束'),
(9, 1, 0, '后台控制器初始化', 'admin_init', 'cmf', '后台控制器初始化'),
(10, 1, 0, '前台控制器初始化', 'home_init', 'cmf', '前台控制器初始化'),
(11, 1, 1, '发送手机验证码', 'send_mobile_verification_code', 'cmf', '发送手机验证码'),
(12, 3, 0, '模板 body标签开始', 'body_start', '', '模板 body标签开始'),
(13, 3, 0, '模板 head标签结束前', 'before_head_end', '', '模板 head标签结束前'),
(14, 3, 0, '模板底部开始', 'footer_start', '', '模板底部开始'),
(15, 3, 0, '模板底部开始之前', 'before_footer', '', '模板底部开始之前'),
(16, 3, 0, '模板底部结束之前', 'before_footer_end', '', '模板底部结束之前'),
(17, 3, 0, '模板 body 标签结束之前', 'before_body_end', '', '模板 body 标签结束之前'),
(18, 3, 0, '模板左边栏开始', 'left_sidebar_start', '', '模板左边栏开始'),
(19, 3, 0, '模板左边栏结束之前', 'before_left_sidebar_end', '', '模板左边栏结束之前'),
(20, 3, 0, '模板右边栏开始', 'right_sidebar_start', '', '模板右边栏开始'),
(21, 3, 0, '模板右边栏结束之前', 'before_right_sidebar_end', '', '模板右边栏结束之前'),
(22, 3, 1, '评论区', 'comment', '', '评论区'),
(23, 3, 1, '留言区', 'guestbook', '', '留言区'),
(24, 2, 0, '后台首页仪表盘', 'admin_dashboard', 'admin', '后台首页仪表盘'),
(25, 4, 0, '后台模板 head标签结束前', 'admin_before_head_end', '', '后台模板 head标签结束前'),
(26, 4, 0, '后台模板 body 标签结束之前', 'admin_before_body_end', '', '后台模板 body 标签结束之前'),
(27, 2, 0, '后台登录页面', 'admin_login', 'admin', '后台登录页面'),
(28, 1, 1, '前台模板切换', 'switch_theme', 'cmf', '前台模板切换'),
(29, 3, 0, '主要内容之后', 'after_content', '', '主要内容之后'),
(30, 2, 0, '文章显示之前', 'portal_before_assign_article', 'portal', '文章显示之前'),
(31, 2, 0, '后台文章保存之后', 'portal_admin_after_save_article', 'portal', '后台文章保存之后'),
(32, 2, 1, '获取上传界面', 'fetch_upload_view', 'user', '获取上传界面'),
(33, 3, 0, '主要内容之前', 'before_content', 'cmf', '主要内容之前'),
(34, 1, 0, '日志写入完成', 'log_write_done', 'cmf', '日志写入完成'),
(35, 1, 1, '后台模板切换', 'switch_admin_theme', 'cmf', '后台模板切换');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_hook_plugin`
--
CREATE TABLE IF NOT EXISTS `cmf_hook_plugin` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
`hook` varchar(50) NOT NULL DEFAULT '' COMMENT '钩子名',
`plugin` varchar(50) NOT NULL DEFAULT '' COMMENT '插件',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统钩子插件表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_link`
--
CREATE TABLE IF NOT EXISTS `cmf_link` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:显示;0:不显示',
`rating` int(11) NOT NULL DEFAULT '0' COMMENT '友情链接评级',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '友情链接描述',
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '友情链接地址',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '友情链接名称',
`image` varchar(100) NOT NULL DEFAULT '' COMMENT '友情链接图标',
`target` varchar(10) NOT NULL DEFAULT '' COMMENT '友情链接打开方式',
`rel` varchar(50) NOT NULL DEFAULT '' COMMENT '链接与网站的关系',
PRIMARY KEY (`id`),
KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='友情链接表';
--
-- 转存表中的数据 `cmf_link`
--
INSERT INTO `cmf_link` (`id`, `status`, `rating`, `list_order`, `description`, `url`, `name`, `image`, `target`, `rel`) VALUES
(1, 1, 1, 8, 'thinkcmf官网', 'http://www.thinkcmf.com', 'ThinkCMF', '', '_blank', '');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_nav`
--
CREATE TABLE IF NOT EXISTS `cmf_nav` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`is_main` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否为主导航;1:是;0:不是',
`name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '导航位置名称',
`remark` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='前台导航位置表';
--
-- 转存表中的数据 `cmf_nav`
--
INSERT INTO `cmf_nav` (`id`, `is_main`, `name`, `remark`) VALUES
(1, 1, '主导航', '主导航'),
(2, 0, '底部导航', '');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_nav_menu`
--
CREATE TABLE IF NOT EXISTS `cmf_nav_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nav_id` int(11) NOT NULL COMMENT '导航 id',
`parent_id` int(11) NOT NULL COMMENT '父 id',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:显示;0:隐藏',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
`target` varchar(10) NOT NULL DEFAULT '' COMMENT '打开方式',
`href` varchar(100) NOT NULL DEFAULT '' COMMENT '链接',
`icon` varchar(20) NOT NULL DEFAULT '' COMMENT '图标',
`path` varchar(255) NOT NULL DEFAULT '' COMMENT '层级关系',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='前台导航菜单表';
--
-- 转存表中的数据 `cmf_nav_menu`
--
INSERT INTO `cmf_nav_menu` (`id`, `nav_id`, `parent_id`, `status`, `list_order`, `name`, `target`, `href`, `icon`, `path`) VALUES
(1, 1, 0, 1, 0, '首页', '', 'home', '', '0-1');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_option`
--
CREATE TABLE IF NOT EXISTS `cmf_option` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`autoload` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '是否自动加载;1:自动加载;0:不自动加载',
`option_name` varchar(64) NOT NULL DEFAULT '' COMMENT '配置名',
`option_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '配置值',
PRIMARY KEY (`id`),
UNIQUE KEY `option_name` (`option_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='全站配置表' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- 表的结构 `cmf_plugin`
--
CREATE TABLE IF NOT EXISTS `cmf_plugin` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增id',
`type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '插件类型;1:网站;8:微信',
`has_admin` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否有后台管理,0:没有;1:有',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:开启;0:禁用',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '插件安装时间',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '插件标识名,英文字母(惟一)',
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '插件名称',
`demo_url` varchar(50) NOT NULL DEFAULT '' COMMENT '演示地址,带协议',
`hooks` varchar(255) NOT NULL DEFAULT '' COMMENT '实现的钩子;以“,”分隔',
`author` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '插件作者',
`author_url` varchar(50) NOT NULL DEFAULT '' COMMENT '作者网站链接',
`version` varchar(20) NOT NULL DEFAULT '' COMMENT '插件版本号',
`description` varchar(255) NOT NULL COMMENT '插件描述',
`config` text COMMENT '插件配置',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_portal_category`
--
CREATE TABLE IF NOT EXISTS `cmf_portal_category` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分类id',
`parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类父id',
`post_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类文章数',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布,0:不发布',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分类名称',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '分类描述',
`path` varchar(255) NOT NULL DEFAULT '' COMMENT '分类层级关系路径',
`seo_title` varchar(100) NOT NULL DEFAULT '',
`seo_keywords` varchar(255) NOT NULL DEFAULT '',
`seo_description` varchar(255) NOT NULL DEFAULT '',
`list_tpl` varchar(50) NOT NULL DEFAULT '' COMMENT '分类列表模板',
`one_tpl` varchar(50) NOT NULL DEFAULT '' COMMENT '分类文章页模板',
`more` text COMMENT '扩展属性',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章分类表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_portal_category_post`
--
CREATE TABLE IF NOT EXISTS `cmf_portal_category_post` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`post_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文章id',
`category_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '分类id',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布;0:不发布',
PRIMARY KEY (`id`),
KEY `term_taxonomy_id` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='portal应用 分类文章对应表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_portal_post`
--
CREATE TABLE IF NOT EXISTS `cmf_portal_post` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父级id',
`post_type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '类型,1:文章;2:页面',
`post_format` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '内容格式;1:html;2:md',
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发表者用户id',
`post_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:已发布;0:未发布;',
`comment_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '评论状态;1:允许;0:不允许',
`is_top` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶;1:置顶;0:不置顶',
`recommended` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否推荐;1:推荐;0:不推荐',
`post_hits` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '查看数',
`post_like` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点赞数',
`comment_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '评论数',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',
`published_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发布时间',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
`post_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'post标题',
`post_keywords` varchar(150) NOT NULL DEFAULT '' COMMENT 'seo keywords',
`post_excerpt` varchar(500) NOT NULL DEFAULT '' COMMENT 'post摘要',
`post_source` varchar(150) NOT NULL DEFAULT '' COMMENT '转载文章的来源',
`post_content` text COMMENT '文章内容',
`post_content_filtered` text COMMENT '处理过的文章内容',
`more` text COMMENT '扩展属性,如缩略图;格式为json',
PRIMARY KEY (`id`),
KEY `type_status_date` (`post_type`,`post_status`,`create_time`,`id`),
KEY `parent_id` (`parent_id`),
KEY `user_id` (`user_id`),
KEY `create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章表' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- 表的结构 `cmf_portal_tag`
--
CREATE TABLE IF NOT EXISTS `cmf_portal_tag` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分类id',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布,0:不发布',
`recommended` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否推荐;1:推荐;0:不推荐',
`post_count` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签文章数',
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '标签名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='portal应用 文章标签表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_portal_tag_post`
--
CREATE TABLE IF NOT EXISTS `cmf_portal_tag_post` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`tag_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签 id',
`post_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '文章 id',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:发布;0:不发布',
PRIMARY KEY (`id`),
KEY `post_id` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='portal应用 标签文章对应表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_recycle_bin`
--
CREATE TABLE IF NOT EXISTS `cmf_recycle_bin` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`object_id` int(11) DEFAULT '0' COMMENT '删除内容 id',
`create_time` int(10) UNSIGNED DEFAULT '0' COMMENT '创建时间',
`table_name` varchar(60) DEFAULT '' COMMENT '删除内容所在表名',
`name` varchar(255) DEFAULT '' COMMENT '删除内容名称',
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=' 回收站';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_role`
--
CREATE TABLE IF NOT EXISTS `cmf_role` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '父角色ID',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '状态;0:禁用;1:正常',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',
`list_order` float NOT NULL DEFAULT '0' COMMENT '排序',
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '角色名称',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
--
-- 转存表中的数据 `cmf_role`
--
INSERT INTO `cmf_role` (`id`, `parent_id`, `status`, `create_time`, `update_time`, `list_order`, `name`, `remark`) VALUES
(1, 0, 1, 1329633709, 1329633709, 0, '超级管理员', '拥有网站最高管理员权限!'),
(2, 0, 1, 1329633709, 1329633709, 0, '普通管理员', '权限由最高管理员分配!');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_role_user`
--
CREATE TABLE IF NOT EXISTS `cmf_role_user` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`role_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '角色 id',
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',
PRIMARY KEY (`id`),
KEY `role_id` (`role_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色对应表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_route`
--
CREATE TABLE IF NOT EXISTS `cmf_route` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '路由id',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`status` tinyint(2) NOT NULL DEFAULT '1' COMMENT '状态;1:启用,0:不启用',
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'URL规则类型;1:用户自定义;2:别名添加',
`full_url` varchar(255) NOT NULL DEFAULT '' COMMENT '完整url',
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '实际显示的url',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='url路由表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_slide`
--
CREATE TABLE IF NOT EXISTS `cmf_slide` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:显示,0不显示',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
`name` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片分类',
`remark` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '分类备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幻灯片表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_slide_item`
--
CREATE TABLE IF NOT EXISTS `cmf_slide_item` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`slide_id` int(11) NOT NULL DEFAULT '0' COMMENT '幻灯片id',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1:显示;0:隐藏',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '幻灯片名称',
`image` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片图片',
`url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '幻灯片链接',
`target` varchar(10) NOT NULL DEFAULT '' COMMENT '友情链接打开方式',
`description` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '幻灯片描述',
`content` text CHARACTER SET utf8 COMMENT '幻灯片内容',
`more` text COMMENT '链接打开方式',
PRIMARY KEY (`id`),
KEY `slide_id` (`slide_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幻灯片子项表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_theme`
--
CREATE TABLE IF NOT EXISTS `cmf_theme` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '安装时间',
`update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后升级时间',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '模板状态,1:正在使用;0:未使用',
`is_compiled` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否为已编译模板',
`theme` varchar(20) NOT NULL DEFAULT '' COMMENT '主题目录名,用于主题的维一标识',
`name` varchar(20) NOT NULL DEFAULT '' COMMENT '主题名称',
`version` varchar(20) NOT NULL DEFAULT '' COMMENT '主题版本号',
`demo_url` varchar(50) NOT NULL DEFAULT '' COMMENT '演示地址,带协议',
`thumbnail` varchar(100) NOT NULL DEFAULT '' COMMENT '缩略图',
`author` varchar(20) NOT NULL DEFAULT '' COMMENT '主题作者',
`author_url` varchar(50) NOT NULL DEFAULT '' COMMENT '作者网站链接',
`lang` varchar(10) NOT NULL DEFAULT '' COMMENT '支持语言',
`keywords` varchar(50) NOT NULL DEFAULT '' COMMENT '主题关键字',
`description` varchar(100) NOT NULL DEFAULT '' COMMENT '主题描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `cmf_theme_file`
--
CREATE TABLE IF NOT EXISTS `cmf_theme_file` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`is_public` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否公共的模板文件',
`list_order` float NOT NULL DEFAULT '10000' COMMENT '排序',
`theme` varchar(20) NOT NULL DEFAULT '' COMMENT '模板名称',
`name` varchar(20) NOT NULL DEFAULT '' COMMENT '模板文件名',
`action` varchar(50) NOT NULL DEFAULT '' COMMENT '操作',
`file` varchar(50) NOT NULL DEFAULT '' COMMENT '模板文件,相对于模板根目录,如Portal/index.html',
`description` varchar(100) NOT NULL DEFAULT '' COMMENT '模板文件描述',
`more` text COMMENT '模板更多配置,用户自己后台设置的',
`config_more` text COMMENT '模板更多配置,来源模板的配置文件',
`draft_more` text COMMENT '模板更多配置,用户临时保存的配置',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `cmf_third_party_user`
--
CREATE TABLE IF NOT EXISTS `cmf_third_party_user` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '本站用户id',
`last_login_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'access_token过期时间',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '绑定时间',
`login_times` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '登录次数',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态;1:正常;0:禁用',
`nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '用户昵称',
`third_party` varchar(20) NOT NULL DEFAULT '' COMMENT '第三方惟一码',
`app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '第三方应用 id',
`last_login_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '最后登录ip',
`access_token` varchar(512) NOT NULL DEFAULT '' COMMENT '第三方授权码',
`openid` varchar(40) NOT NULL DEFAULT '' COMMENT '第三方用户id',
`union_id` varchar(64) NOT NULL DEFAULT '' COMMENT '第三方用户多个产品中的惟一 id,(如:微信平台)',
`more` text COMMENT '扩展信息',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='第三方用户表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user`
--
CREATE TABLE IF NOT EXISTS `cmf_user` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_type` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '用户类型;1:admin;2:会员',
`sex` tinyint(2) NOT NULL DEFAULT '0' COMMENT '性别;0:保密,1:男,2:女',
`birthday` int(11) NOT NULL DEFAULT '0' COMMENT '生日',
`last_login_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '用户积分',
`coin` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '金币',
`balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '注册时间',
`user_status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '用户状态;0:禁用,1:正常,2:未验证',
`user_login` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户名',
`user_pass` varchar(64) NOT NULL DEFAULT '' COMMENT '登录密码;cmf_password加密',
`user_nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
`user_email` varchar(100) NOT NULL DEFAULT '' COMMENT '用户登录邮箱',
`user_url` varchar(100) NOT NULL DEFAULT '' COMMENT '用户个人网址',
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像',
`signature` varchar(255) NOT NULL DEFAULT '' COMMENT '个性签名',
`last_login_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '最后登录ip',
`user_activation_key` varchar(60) NOT NULL DEFAULT '' COMMENT '激活码',
`mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '用户手机号',
`more` text COMMENT '扩展属性',
PRIMARY KEY (`id`),
KEY `user_login` (`user_login`),
KEY `user_nickname` (`user_nickname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_action`
--
CREATE TABLE IF NOT EXISTS `cmf_user_action` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`score` int(11) NOT NULL DEFAULT '0' COMMENT '更改积分,可以为负',
`coin` int(11) NOT NULL DEFAULT '0' COMMENT '更改金币,可以为负',
`reward_number` int(11) NOT NULL DEFAULT '0' COMMENT '奖励次数',
`cycle_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '周期类型;0:不限;1:按天;2:按小时;3:永久',
`cycle_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '周期时间值',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',
`action` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',
`app` varchar(50) NOT NULL DEFAULT '' COMMENT '操作所在应用名或插件名等',
`url` text COMMENT '执行操作的url',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户操作表';
--
-- 转存表中的数据 `cmf_user_action`
--
INSERT INTO `cmf_user_action` VALUES ('1', '1', '1', '1', '2', '1', '用户登录', 'login', 'user', '');
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_action_log`
--
CREATE TABLE IF NOT EXISTS `cmf_user_action_log` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户id',
`count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '访问次数',
`last_visit_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后访问时间',
`object` varchar(100) NOT NULL DEFAULT '' COMMENT '访问对象的id,格式:不带前缀的表名+id;如posts1表示xx_posts表里id为1的记录',
`action` varchar(50) NOT NULL DEFAULT '' COMMENT '操作名称;格式:应用名+控制器+操作名,也可自己定义格式只要不发生冲突且惟一;',
`ip` varchar(15) NOT NULL DEFAULT '' COMMENT '用户ip',
PRIMARY KEY (`id`),
KEY `user_object_action` (`user_id`,`object`,`action`),
KEY `user_object_action_ip` (`user_id`,`object`,`action`,`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问记录表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_balance_log`
--
CREATE TABLE IF NOT EXISTS `cmf_user_balance_log` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户 id',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
`change` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '更改余额',
`balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '更改后余额',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户余额变更日志表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_favorite`
--
CREATE TABLE IF NOT EXISTS `cmf_user_favorite` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户 id',
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '收藏内容的标题',
`url` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '收藏内容的原文地址,不带域名',
`description` varchar(500) CHARACTER SET utf8 DEFAULT '' COMMENT '收藏内容的描述',
`table_name` varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '收藏实体以前所在表,不带前缀',
`object_id` int(10) UNSIGNED DEFAULT '0' COMMENT '收藏内容原来的主键id',
`create_time` int(10) UNSIGNED DEFAULT '0' COMMENT '收藏时间',
PRIMARY KEY (`id`),
KEY `uid` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户收藏表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_login_attempt`
--
CREATE TABLE IF NOT EXISTS `cmf_user_login_attempt` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`login_attempts` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '尝试次数',
`attempt_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '尝试登录时间',
`locked_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '锁定时间',
`ip` varchar(15) NOT NULL DEFAULT '' COMMENT '用户 ip',
`account` varchar(100) NOT NULL DEFAULT '' COMMENT '用户账号,手机号,邮箱或用户名',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户登录尝试表' ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_score_log`
--
CREATE TABLE IF NOT EXISTS `cmf_user_score_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户 id',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`action` varchar(50) NOT NULL DEFAULT '' COMMENT '用户操作名称',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '更改积分,可以为负',
`coin` int(11) NOT NULL DEFAULT '0' COMMENT '更改金币,可以为负',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户操作积分等奖励日志表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_user_token`
--
CREATE TABLE IF NOT EXISTS `cmf_user_token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用户id',
`expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT ' 过期时间',
`create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
`token` varchar(64) NOT NULL DEFAULT '' COMMENT 'token',
`device_type` varchar(10) NOT NULL DEFAULT '' COMMENT '设备类型;mobile,android,iphone,ipad,web,pc,mac,wxapp',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户客户端登录 token 表';
-- --------------------------------------------------------
--
-- 表的结构 `cmf_verification_code`
--
CREATE TABLE IF NOT EXISTS `cmf_verification_code` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '表id',
`count` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '当天已经发送成功的次数',
`send_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后发送成功时间',
`expire_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '验证码过期时间',
`code` varchar(8) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '最后发送成功的验证码',
`account` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '手机号或者邮箱',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='手机邮箱数字验证码表';
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
return [
'ACCEPT' => 'ACCEPT'
];
\ No newline at end of file
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
return [
'ACCEPT' => '接 受'
];
\ No newline at end of file
<!doctype html>
<html>
<head>
<include file="public/head" />
</head>
<body>
<div class="wrap">
<include file="public/header" />
<div class="section">
<div class="main">
<pre class="agreement">ThinkCMF软件使用协议
版权所有 ©2013-{:date("Y")},ThinkCMF开源社区
感谢您选择ThinkCMF内容管理框架, 希望我们的产品能够帮您把网站发展的更快、更好、更强!
ThinkCMF遵循Apache Lisense 2.0开源协议发布,并提供免费使用。
ThinkCMF建站系统由简约风网络科技(以下简称简约风,官网http://www.thinkcmf.com)发起并开源发布。
简约风网络科技包含以下网站:
ThinkCMF官网: http://www.thinkcmf.com
ThinkCMF免责声明
1、使用ThinkCMF构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果,ThinkCMF官方不承担任何责任。
2、您一旦安装使用ThinkCMF,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。</pre>
</div>
<div class="bottom text-center">
<a href="__ROOT__/?s=install/index/step2" class="btn btn-primary">{:lang('ACCEPT')}</a>
</div>
</div>
</div>
<include file="public/footer" />
</body>
</html>
\ No newline at end of file
<div class="footer">
&copy; 2013-{:date('Y')} <a href="http://www.thinkcmf.com" target="_blank">ThinkCMF Team</a>
</div>
\ No newline at end of file
<meta charset="utf-8" />
<title>ThinkCMF安装</title>
<link rel="stylesheet" href="__STATIC__/install/simpleboot/themes/flat/theme.min.css" />
<link rel="stylesheet" href="__STATIC__/install/css/install.css" />
<link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css" type="text/css">
<div class="header">
<h1 class="logo">ThinkCMF 安装向导</h1>
<div class="version">{$Think.THINKCMF_VERSION}</div>
</div>
\ No newline at end of file
<!doctype html>
<html>
<head>
<include file="public/head"/>
<script src="__STATIC__/js/jquery.js"></script>
<style>
.rewrite-correct, .rewrite-error {
display: none;
}
</style>
</head>
<body>
<div class="wrap">
<include file="public/header"/>
<section class="section">
<div class="step">
<ul class="unstyled">
<li class="current"><em>1</em>检测环境</li>
<li><em>2</em>创建数据</li>
<li><em>3</em>完成安装</li>
</ul>
</div>
<div class="server">
<table width="100%">
<tr>
<td class="td1">环境检测</td>
<td class="td1" width="25%">推荐配置</td>
<td class="td1" width="25%">当前状态</td>
<td class="td1" width="25%">最低要求</td>
</tr>
<tr>
<td>操作系统</td>
<td>类UNIX</td>
<td><i class="fa fa-check correct"></i> {$os}</td>
<td>不限制</td>
</tr>
<tr>
<td>PHP版本</td>
<td>>5.6.x</td>
<td><i class="fa fa-check correct"></i> {$phpversion}</td>
<td>5.4.0</td>
</tr>
<!-- 模块检测 -->
<tr>
<td class="td1" colspan="4">
模块检测
</td>
</tr>
<tr>
<td>session</td>
<td>开启</td>
<td>
{$session}
</td>
<td>开启</td>
</tr>
<tr>
<td>
PDO
<a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$pdo}
</td>
<td>开启</td>
</tr>
<tr>
<td>
PDO_MySQL
<a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$pdo_mysql}
</td>
<td>开启</td>
</tr>
<tr>
<td>
CURL
<a href="https://www.baidu.com/s?wd=开启PHP CURL扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$curl}
</td>
<td>开启</td>
</tr>
<tr>
<td>
GD
<a href="https://www.baidu.com/s?wd=开启PHP GD扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$gd}
</td>
<td>开启</td>
</tr>
<tr>
<td>
MBstring
<a href="https://www.baidu.com/s?wd=开启PHP MBstring扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$mbstring}
</td>
<td>开启</td>
</tr>
<tr>
<td>
fileinfo
<a href="https://www.baidu.com/s?wd=开启PHP fileinfo扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
{$fileinfo}
</td>
<td>开启</td>
</tr>
<notempty name="show_always_populate_raw_post_data_tip">
<tr>
<td>
$HTTP_RAW_POST_DATA关闭检测
<a href="https://www.baidu.com/s?wd=开启PHP fileinfo扩展" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>关闭</td>
<td>
{$always_populate_raw_post_data}
</td>
<td>关闭</td>
</tr>
<tr>
<td>$HTTP_RAW_POST_DATA未关闭解决</td>
<td colspan="3">
<pre>
;php.ini 找到 always_populate_raw_post_data设置如下:
always_populate_raw_post_data = -1
</pre>
</td>
</tr>
</notempty>
<!-- rewrite检测 -->
<tr>
<td class="td1" colspan="4">
rewrite检测(开启rewrite更利于网站SEO优化)
</td>
</tr>
<tr>
<td>
服务器rewrite
<a href="https://www.kancloud.cn/thinkcmf/faq/493492" target="_blank">
<i class="fa fa-question-circle question"></i>
</a>
</td>
<td>开启</td>
<td>
<span class="rewrite-checking">正在检测...</span>
<span class="rewrite-correct"><i class="fa fa-check correct"></i> 支持</span>
<span class="rewrite-error"><i class="fa fa-remove error"></i> 不支持</span>
</td>
<td>开启</td>
</tr>
<!-- 大小限制检测 -->
<tr>
<td class="td1" colspan="4">
大小限制检测
</td>
</tr>
<tr>
<td>附件上传</td>
<td>>2M</td>
<td>
{$upload_size}
</td>
<td>不限制</td>
</tr>
</table>
<table width="100%">
<tr>
<td class="td1">目录、文件权限检查</td>
<td class="td1" width="25%">写入</td>
<td class="td1" width="25%">读取</td>
</tr>
<foreach name="folders" item="vo" key="dir">
<tr>
<td>
{$dir}
</td>
<td>
<if condition="$vo['w']">
<i class="fa fa-check correct"></i> 可写
<else/>
<i class="fa fa-remove error"></i> 不可写
</if>
</td>
<td>
<if condition="$vo['r']">
<i class="fa fa-check correct"></i> 可读
<else/>
<i class="fa fa-remove error"></i> 不可读
</if>
</td>
</tr>
</foreach>
</table>
</div>
<div class="bottom text-center">
<a href="__ROOT__/?s=install/index/step2" class="btn btn-primary">重新检测</a>
<a href="{:url('index/step3')}" class="btn btn-primary">下一步</a>
</div>
</section>
</div>
<include file="public/footer"/>
<script>
$.ajax({
url: "__ROOT__/install/index/testRewrite",
type: 'POST',
dataType: 'JSON',
success: function (data) {
if (data.code) {
$('.rewrite-correct').show();
$('.rewrite-checking').hide();
}
},
error: function () {
$('.rewrite-error').show();
$('.rewrite-checking').hide();
}
})
</script>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<include file="public/head"/>
</head>
<body>
<div class="wrap">
<include file="public/header"/>
<section class="section">
<div class="step">
<ul class="unstyled">
<li class="on"><em>1</em>检测环境</li>
<li class="current"><em>2</em>创建数据</li>
<li><em>3</em>完成安装</li>
</ul>
</div>
<form id="js-install-form" action="{:url('index/step4')}" method="post">
<input type="hidden" name="force" value="0"/>
<div class="server">
<table width="100%">
<tr>
<td class="td1" width="100">数据库信息</td>
<td class="td1" width="200">&nbsp;</td>
<td class="td1">&nbsp;</td>
</tr>
<tr>
<td class="text-left">数据库服务器:</td>
<td><input type="text" name="dbhost" id="dbhost" value="127.0.0.1" class="input"></td>
<td>
<div id="js-install-tip-dbhost">
<span class="gray">数据库服务器地址,一般为127.0.0.1或localhost</span>
</div>
</td>
</tr>
<tr>
<td class="text-left">数据库端口:</td>
<td><input type="text" name="dbport" id="dbport" value="3306" class="input"></td>
<td>
<div id="js-install-tip-dbport">
<span class="gray">数据库服务器端口,一般为3306</span>
</div>
</td>
</tr>
<tr>
<td class="text-left">数据库用户名:</td>
<td><input type="text" name="dbuser" id="dbuser" value="root" class="input"></td>
<td>
<div id="js-install-tip-dbuser"></div>
</td>
</tr>
<tr>
<td class="text-left">数据库密码:</td>
<td>
<input type="password" name="dbpw" id="dbpw" value="" class="input" autoComplete="off"
onblur="TestDbPwd()">
</td>
<td>
<div id="js-install-tip-dbpw"></div>
</td>
</tr>
<tr>
<td class="text-left">数据库名:</td>
<td><input type="text" name="dbname" id="dbname" value="thinkcmf5" class="input"></td>
<td>
<div id="js-install-tip-dbname">
<span class="gray">最好小写字母</span>
</div>
</td>
</tr>
<tr>
<td class="text-left">数据库表前缀:</td>
<td><input type="text" name="dbprefix" id="dbprefix" value="cmf_" class="input"></td>
<td>
<div id="js-install-tip-dbprefix">
<span class="gray">建议使用默认,同一数据库安装多个ThinkCMF时需修改</span>
</div>
</td>
</tr>
<tr>
<td class="text-left">数据库编码:</td>
<td>
<select type="text" name="dbcharset" id="dbcharset" value="" class="input">
<option value="utf8mb4">utf8mb4</option>
<option value="utf8">utf8</option>
</select>
</td>
<td>
<div id="js-install-tip-dbcharset">
<span class="gray">如果您的服务器是虚拟空间不支持uft8mb4,请选择 utf8</span>
</div>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td class="td1" width="100">网站配置</td>
<td class="td1" width="200">&nbsp;</td>
<td class="td1">&nbsp;</td>
</tr>
<tr>
<td class="text-left">网站名称:</td>
<td><input type="text" name="sitename" value="ThinkCMF内容管理框架" class="input"></td>
<td>
<div id="js-install-tip-sitename"></div>
</td>
</tr>
<tr>
<td class="text-left">关键词:</td>
<td>
<input type="text" name="sitekeywords"
value="ThinkCMF,php,内容管理框架,cmf,cms,简约风, simplewind,framework" class="input"
autoComplete="off">
</td>
<td>
<div id="js-install-tip-sitekeywords"></div>
</td>
</tr>
<tr>
<td class="text-left">描述:</td>
<td>
<input type="text" name="siteinfo" class="input" value="ThinkCMF是简约风网络科技发布的一款用于快速开发的内容管理框架">
</td>
<td>
<div id="js-install-tip-siteinfo"></div>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td class="td1" width="100">创始人信息</td>
<td class="td1" width="200">&nbsp;</td>
<td class="td1">&nbsp;</td>
</tr>
<tr>
<td class="text-left">管理员帐号:</td>
<td><input type="text" name="manager" value="admin" class="input"></td>
<td>
<div id="js-install-tip-manager"></div>
</td>
</tr>
<tr>
<td class="text-left">密码:</td>
<td>
<input type="password" name="manager_pwd" id="js-manager-pwd" class="input"
autoComplete="off">
</td>
<td>
<div id="js-install-tip-manager_pwd">
<span class="gray">
密码长度不低于6位,不高于32位。
</span>
</div>
</td>
</tr>
<tr>
<td class="text-left">重复密码:</td>
<td>
<input type="password" name="manager_ckpwd" class="input" autoComplete="off">
</td>
<td>
<div id="js-install-tip-manager_ckpwd"></div>
</td>
</tr>
<tr>
<td class="text-left">Email:</td>
<td><input type="text" name="manager_email" class="input" value=""></td>
<td>
<div id="js-install-tip-manager_email"></div>
</td>
</tr>
</table>
<div id="js-response-tips" style="display: none;"></div>
</div>
<div class="bottom text-center">
<a href="{:url('index/step2')}" class="btn btn-primary">上一步</a>
<button type="submit" class="btn btn-primary">创建数据</button>
</div>
</form>
</section>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/js/validate.js"></script>
<script src="__STATIC__/js/ajaxForm.js"></script>
<script>
function TestDbPwd() {
var dbHost = $('#dbhost').val();
var dbUser = $('#dbuser').val();
var dbPwd = $('#dbpw').val();
var dbName = $('#dbname').val();
var dbPort = $('#dbport').val();
data = {
'hostname': dbHost,
'username': dbUser,
'password': dbPwd,
'hostport': dbPort
};
var url = "{:url('index/testDbPwd')}";
$.ajax({
type: "POST",
url: url,
dataType: 'JSON',
data: data,
beforeSend: function () {
},
success: function (data) {
if (data.code) {
} else {
$('#dbpw').val("");
//数据库链接配置失败
$('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">' + data.msg + '</span>');
}
},
complete: function () {
},
error: function () {
$('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">数据库链接配置失败</span>');
$('#dbpw').val("");
}
});
}
$(function () {
//聚焦时默认提示
var focus_tips = {
dbhost: '数据库服务器地址,一般为127.0.0.1或localhost',
dbport: '数据库服务器端口,一般为3306',
dbuser: '',
dbpw: '',
dbname: '',
dbprefix: '建议使用默认,同一数据库安装多个ThinkCMF时需修改',
dbcharset: '如果您的服务器是虚拟空间不支持uft8mb4,请选择 utf8',
manager: '创始人帐号,拥有站点后台所有管理权限',
manager_pwd: '密码长度不低于6位,不高于32位',
manager_ckpwd: '',
sitename: '',
siteurl: '请以“/”结尾',
sitekeywords: '',
siteinfo: '',
manager_email: ''
};
var install_form = $("#js-install-form");
//validate插件修改了remote ajax验证返回的response处理方式;增加密码强度提示 passwordRank
install_form.validate({
//debug : true,
//onsubmit : false,
errorPlacement: function (error, element) {
//错误提示容器
$('#js-install-tip-' + element[0].name).html(error);
},
errorElement: 'span',
//invalidHandler : , 未验证通过 回调
//ignore : '.ignore' 忽略验证
//onkeyup : true,
errorClass: 'tips-error',
validClass: 'tips-error',
onkeyup: false,
focusInvalid: false,
rules: {
dbhost: {required: true},
dbport: {required: true},
dbuser: {required: true},
/* dbpw: {required : true}, */
dbname: {required: true},
dbprefix: {required: true},
manager: {required: true},
manager_pwd: {required: true, minlength: 6, maxlength: 32},
manager_ckpwd: {required: true, equalTo: '#js-manager-pwd'},
manager_email: {required: true, email: true}
},
highlight: false,
unhighlight: function (element, errorClass, validClass) {
var tip_elem = $('#js-install-tip-' + element.name);
tip_elem.html('<span class="' + validClass + '" data-text="text"><span>');
},
onfocusin: function (element) {
var name = element.name;
$('#js-install-tip-' + name).html('<span data-text="text">' + focus_tips[name] + '</span>');
$(element).parents('tr').addClass('current');
},
onfocusout: function (element) {
var _this = this;
$(element).parents('tr').removeClass('current');
if (element.name === 'email') {
//邮箱匹配点击后,延时处理
setTimeout(function () {
_this.element(element);
}, 150);
} else {
_this.element(element);
}
},
messages: {
dbhost: {required: '数据库服务器地址不能为空'},
dbport: {required: '数据库服务器端口不能为空'},
dbuser: {required: '数据库用户名不能为空'},
dbpw: {required: '数据库密码不能为空'},
dbname: {required: '数据库名不能为空'},
dbprefix: {required: '数据库表前缀不能为空'},
manager: {required: '管理员帐号不能为空'},
manager_pwd: {required: '密码不能为空', minlength: '密码长度不低于{0}位', maxlength: '密码长度不超过{0}位'},
manager_ckpwd: {required: '重复密码不能为空', equalTo: '两次输入的密码不一致,请重新输入.'},
manager_email: {required: 'Email不能为空', email: '请输入正确的电子邮箱地址'}
},
submitHandler: function (form) {
form.submit();
return true;
}
});
});
</script>
</div>
<include file="public/footer"/>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<include file="public/head"/>
<script type="text/javascript">
//全局变量
var GV = {
ROOT: "{:cmf_get_root()}/",
WEB_ROOT: "{:cmf_get_root()}/",
JS_ROOT: "static/js/"
};
</script>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/js/wind.js"></script>
<script type="text/html" id="exec-success-msg-tpl">
<li>
<i class="fa fa-check correct"></i>
{message}<br>
<!--<pre>{sql}</pre>-->
</li>
</script>
<script type="text/html" id="exec-fail-msg-tpl">
<li>
<i class="fa fa-remove error"></i>
{message}<br>
<pre>{sql}</pre>
<!--<pre>{exception}</pre>-->
</li>
</script>
</head>
<body>
<div class="wrap">
<include file="public/header"/>
<section class="section">
<div class="step">
<ul class="unstyled">
<li class="on"><em>1</em>检测环境</li>
<li class="on"><em>2</em>创建数据</li>
<li class="current"><em>3</em>完成安装</li>
</ul>
</div>
<div class="install" id="log">
<ul id="install-msg-panel" class="unstyled"></ul>
</div>
<div class="bottom text-center">
<a href="javascript:;"><i class="fa fa-refresh fa-spin"></i>&nbsp;正在安装...</a>
</div>
</section>
<script type="text/javascript">
$(function () {
install(0);
});
Wind.use("noty", function () {
});
var $installMsgPanel = $('#install-msg-panel');
var $log = $("#log");
var execSuccessTpl = $('#exec-success-msg-tpl').html();
var execFailTpl = $('#exec-fail-msg-tpl').html();
var sqlExecResult;
function install(sqlIndex) {
$.ajax({
url: "{:url('install/index/install')}",
data: {sql_index: sqlIndex},
dataType: 'json',
type: 'post',
success: function (data) {
console.log(data);
var line = sqlIndex + 1;
if (data.code == 1) {
if (!(data.data && data.data.done)) {
var tpl = execSuccessTpl;
tpl = tpl.replace(/\{message\}/g, line + '.' + data.msg);
tpl = tpl.replace(/\{sql\}/g, data.data.sql);
$installMsgPanel.append(tpl);
} else {
$installMsgPanel.append('<li><i class="fa fa-check correct"></i>数据库安装完成!</li>');
sqlExecResult = data.data;
if (data.data.error) {
noty({
text: "安装过程,共" + data.data.error + "个SQL执行错误,可能您在此数据库下已经安装过 CMF,请查看问题后重新安装,或者<br>"
+ '<a target="_blank" href="https://github.com/thinkcmf/thinkcmf/issues">反馈问题</a>',
type: 'confirm',
layout: "center",
timeout: false,
modal: true,
buttons: [
{
addClass: 'btn btn-primary',
text: '确定',
onClick: function ($noty) {
$noty.close();
//setDbConfig();
}
},
{
addClass: 'btn btn-danger',
text: '取消',
onClick: function ($noty) {
$noty.close();
}
}
]
});
} else {
setDbConfig();
}
}
} else if (data.code == 0) {
var tpl = execFailTpl;
tpl = tpl.replace(/\{message\}/g, line + '.' + data.msg);
tpl = tpl.replace(/\{sql\}/g, data.data.sql);
tpl = tpl.replace(/\{exception\}/g, data.data.exception);
$installMsgPanel.append(tpl);
}
$log.scrollTop(1000000000);
if (!(data.data && data.data.done)) {
sqlIndex++;
install(sqlIndex);
}
},
error: function () {
},
complete: function () {
}
});
}
function setDbConfig() {
$.ajax({
url: "{:url('install/index/setDbConfig')}",
dataType: 'json',
data:{_hithinkcmf:1},
type: 'post',
success: function (data) {
if (data.code == 1) {
$installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
setSite();
} else {
$installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
noty({
text: data.msg + ',请检查 data/conf/database.php 是否可写!',
type: 'confirm',
layout: "center",
timeout: false,
modal: true,
buttons: [
{
addClass: 'btn btn-primary',
text: '重试',
onClick: function ($noty) {
$noty.close();
setDbConfig();
}
},
{
addClass: 'btn btn-danger',
text: '取消',
onClick: function ($noty) {
$noty.close();
}
}
]
});
}
},
error: function () {
}
});
}
function setSite() {
$.ajax({
url: "{:url('install/index/setSite')}",
dataType: 'json',
data:{_hithinkcmf:1},
type: 'post',
success: function (data) {
if (data.code == 1) {
$installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
installTheme();
} else {
$installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
noty({
text: data.msg,
type: 'confirm',
layout: "center",
timeout: false,
modal: true,
buttons: [
{
addClass: 'btn btn-primary',
text: '重试',
onClick: function ($noty) {
$noty.close();
setSite();
}
},
{
addClass: 'btn btn-danger',
text: '取消',
onClick: function ($noty) {
$noty.close();
}
}
]
});
}
},
error: function () {
}
});
}
function installTheme() {
$.ajax({
url: "{:url('install/index/installTheme')}",
dataType: 'json',
data:{_hithinkcmf:1},
type: 'post',
success: function (data) {
if (data.code == 1) {
$installMsgPanel.append('<li><i class="fa fa-check correct"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
setTimeout(function () {
window.location = "{:url('install/index/step5')}";
}, 1000);
} else {
$installMsgPanel.append('<li><i class="fa fa-remove error"></i>' + data.msg + '</li>');
$log.scrollTop(1000000000);
noty({
text: data.msg,
type: 'confirm',
layout: "center",
timeout: false,
modal: true,
buttons: [
{
addClass: 'btn btn-primary',
text: '重试',
onClick: function ($noty) {
$noty.close();
installTheme();
}
},
{
addClass: 'btn btn-danger',
text: '取消',
onClick: function ($noty) {
$noty.close();
}
}
]
});
}
},
error: function () {
}
});
}
</script>
</div>
<include file="public/footer"/>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<include file="public/head"/>
<script src="__STATIC__/js/jquery.js"></script>
</head>
<body>
<div class="wrap">
<include file="public/header"/>
<section class="section">
<div style="padding: 40px 20px;">
<div class="text-center">
<a style="font-size: 18px;">恭喜您,安装完成!</a>
<br>
<br>
<div class="alert alert-danger" style="width: 360px;display: inline-block;">
为了您的站点安全,安装完成后即可将网站app目录下的“install”文件夹删除!
另请对data/conf/database.php文件做好备份,以防丢失!
</div>
</div>
<div class="accordion">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle"
href="https://www.thinkcmf.com/topic/1508.html"
target="_blank">
ThinkCMF5入门必看!
</a>
</div>
<div class="accordion-body collapse in">
<div class="accordion-inner">
<p>
ThinkCMF5完全开发手册:
<a href="http://www.kancloud.cn/thinkcmf/doc" target="_blank">http://www.kancloud.cn/thinkcmf/doc</a>
</p>
<p>
ThinkCMF5核心理念:
<a href="http://www.kancloud.cn/thinkcmf/doc/313906" target="_blank">http://www.kancloud.cn/thinkcmf/doc/313906</a>
</p>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle"
href="http://www.kancloud.cn/thinkcmf/cmf5api" target="_blank">
ThinkCMF API开发及小程序开发入门必看!
</a>
</div>
<div class="accordion-body collapse in">
<div class="accordion-inner">
<p>
CMF5 API开发手册:
<a href="http://www.kancloud.cn/thinkcmf/cmf5api" target="_blank">http://www.kancloud.cn/thinkcmf/cmf5api</a>
</p>
<p>
小程序开发:
<a href="https://www.kancloud.cn/thinkcmf/cmf5api/451391" target="_blank">https://www.kancloud.cn/thinkcmf/cmf5api/451391</a>
</p>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle"
href="https://www.thinkcmf.com/college.html" target="_blank">
ThinkCMF学院视频教程
</a>
</div>
<div class="accordion-body collapse in">
<div class="accordion-inner">
<p>
ThinkCMF模板开发视频:
<a href="https://chuanke.baidu.com/v4472461-241676-1805249.html"
target="_blank">https://chuanke.baidu.com/v4472461-241676-1805249.html</a>
</p>
<p>
ThinkCMF5快速入门:
<a href="https://www.thinkcmf.com/topic/1405.html"
target="_blank">https://www.thinkcmf.com/topic/1405.html</a>
</p>
</div>
</div>
</div>
</div>
<div class="text-center">
<a class="btn btn-success" href="{:cmf_get_root()}/">进入前台</a>
<a class="btn btn-success" href="{:cmf_get_root()}/admin">进入后台</a>
</div>
</div>
</section>
</div>
<include file="public/footer"/>
<script>
$(function () {
return;
$.ajax({
type: "POST",
url: "http://www.thinkcmf.com/service/installinfo.php",
data: {
host: "{$host|default=''}",
ip: "{$ip|default=''}"
},
dataType: 'json',
success: function () {
}
});
});
</script>
</body>
</html>
\ No newline at end of file
... ... @@ -30,369 +30,9 @@ class IndexController extends CommonController
{
public function index()
{
// $return = $this->wxpay(['order_sn'=>201807211101],'保证金支付');
// $qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);
// echo '<img src="'.$qrcode_url.'" alt=""/>';
// $back = [
// 'return'=>$return,
// 'code_url'=>base64_encode($return['code_url']),
// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',
// 'alipay_url'=>url('portal/Alipay/alipay',array('order_sn'=>201807211101,'name'=>'保证金支付','price'=>0.01))
// ];
// $this->redirect($back['alipay_url']);
// $data = [
// 'out_trade_no'=>'2018072798495757',
// 'trade_no'=>'2018072721001004410589897579',
// 'out_request_no'=>'2018072798495757',
// 'refund_amount'=>0.01,
// 'refund_reason'=>'中介报价少于3人退款'
// ];
// $alipay = controller('Alipay');
// $result = $alipay->refundquery($data);
// $object = $result->alipay_trade_fastpay_refund_query_response;
// var_dump($result->alipay_trade_fastpay_refund_query_response);
// echo "<pre/>";
// print_r('7777');
// die;
//// 合作企业
// $where_coo['status'] = 1;
// $final['coop'] = Db::name('Cooperation')->where($where_coo)->order("score desc , create_time desc")->field('pic')->select()->toArray();
return $this->fetch(':index');
}
public function api_test() {
$key = '123456';
$data = [
'pid' => 17515,
'name' => 'huawei-6p'
];
// $id=$this->request->param('pid');
// $name=$this->request->param('name');
$id=$data['pid'];
$name=$data['name'];
$time=date('Y-m-d H:i:s');
$sign=md5($id.$name.$time.$key);
$file=[
'pid'=>$id,
'name'=>$name,
'time'=>$time,
'sign'=>$sign
];
$url="http://118.25.20.60/account.do?pid=$id&name=$name&time=$time&sign=$sign";
echo $url."<br/>";
// $result = file_get_contents($url);
$result = $this->curl($url,$file);
var_dump($result);
}
protected function curl($url,$data = null) {
// 初始化
$curl = curl_init();
// 设置抓取的url
curl_setopt($curl, CURLOPT_URL, $url);
// 设置头文件的信息作为数据流输出
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
// 设置获取的信息以文件流的形式返回,而不是直接输出。
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($curl, CURLOPT_POST, true); // 发送一个常规的Post请求
// curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包
// 执行命令
$data = curl_exec($curl);
if (curl_errno($curl)) {
$data = curl_error($curl);
}
// 关闭URL请求
curl_close($curl);
// 显示获得的数据
return $data;
}
public function wap_index()
{
// $return = $this->wxpay(['order_sn'=>201807211032],'保证金支付');
// $qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);
// echo '<img src="'.$qrcode_url.'" alt=""/>';
$back = [
// 'return'=>$return,
// 'code_url'=>base64_encode($return['code_url']),
// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',
'alipay_url'=>url('portal/AlipayWap/alipay',array('order_sn'=>201807211100,'name'=>'保证金支付','price'=>0.01))
];
$this->redirect($back['alipay_url']);
// echo "<pre/>";
// print_r('7777');
// die;
//// 合作企业
// $where_coo['status'] = 1;
// $final['coop'] = Db::name('Cooperation')->where($where_coo)->order("score desc , create_time desc")->field('pic')->select()->toArray();
return $this->fetch(':index');
}
// 微信h5支付(测试)
public function wxpayh5() {
require_once VENDOR_PATH.'WxpayAPI/WxpayH5.php';
$h5 = new \WxpayH5('wxf69d1d87d173c899','1507884301','VaY3CqbFLbq2Dw3FRENrixu24E9Qq1ZI','201807211465',
'保证金支付','1','{"h5_info": {"type":"Wap","wap_url": "http://houseprice.w.bronet.cn","wap_name": "保证金支付"}}' );
$result = $h5->pay();
var_dump($result);
$mweb_url = '';
if(!empty($result['mweb_url'])) {
$mweb_url = $result['mweb_url'];
}
$this->assign('mwen_url',$mweb_url);
return $this->fetch(':h5');
}
/**
* 微信h5支付(接口)
* @param user_id 用户ID
* @param order_sn 订单号
* @param _type 支付类型 1,发布需求(保证金);2,中介报价;3,透视卡
*/
public function wxpay_web() {
if($this->request->isPost()) {
$data = $this->request->param();
$order_model = new OrderModel();
$orderInfo = $order_model->where(['order_sn'=>$data['order_sn'],'type'=>$data['_type']])->find();
if(empty($orderInfo['status']) || $orderInfo['status'] > 1) {
$this->apiResponse(0,'订单已失效');
}
$type = [
1 => '保证金支付',
2 => '中介报价',
3 => '透视卡'
];
$scene_info = "{'h5_info': {'type':'Wap','wap_url': 'http://houseprice.w.bronet.cn','wap_name': ".$type[$data["_type"]]."}}";
require_once VENDOR_PATH.'WxpayAPI/WxpayH5.php';
// $h5 = new \WxpayH5(config('APP_ID'),config('MCH_ID'),config('WXPAY_KEY'),$data['order_sn'],
// $type[$data['_type']],'1',$scene_info);
$h5 = new \WxpayH5('wxf69d1d87d173c899','1507884301','VaY3CqbFLbq2Dw3FRENrixu24E9Qq1ZI',$data['order_sn'],
$type[$data['_type']],'1',$scene_info);
$result = $h5->pay();
if(empty($result['mweb_url'])) {
$this->apiResponse(0,'生成失败');
}
$return = [
'mwen_url' => $result['mweb_url'],
'create_time' => time(),
'over_time'=>time()+5*60
];
$this->apiResponse(1,'成功',$return);
}
}
// 微信退款(测试)
public function wxrefund() {
require_once VENDOR_PATH.'WxpayAPI/WxRefund.php';
$refund = new \WxRefund(Config::get('wx_appid'),Config::get('wx_mch_id'),Config::get('wx_key'),'4200000140201807275326669498',
'2018072710154991','1','1','中介报价少于3人退款');
$result = $refund->pay();
var_dump($result);
if($result['return_code'] == 'SUCCESS' && $result['return_msg'] == 'OK') {
$refund_model = new RefundModel();
$refund = $refund_model->where(['order_sn'=>$result['out_refund_no']])->find();
// if($refund) {
// echo '订单已申请退款';exit;
// }
$insert = [
'order_id' => 1,
'order_sn' => $result['out_refund_no'],
'user_id' => 24,
'user_type' => 1,
'refund_id' => $result['refund_id'],
'pay_type' => 1,
'reason' => 1,
'create_time' => time(),
'update_time' => time()
];
$refund_model->insertGetId($insert);
} else {
return false;
}
var_dump($result);
}
// 微信退款查询(测试)
public function wxrefundquery() {
require_once VENDOR_PATH.'WxpayAPI/WxRefundQuery.php';
$refund = new \WxRefundQuery(Config::get('wx_appid'),Config::get('wx_mch_id'),Config::get('wx_key'),'4200000139201807280275718105',
'2018072851481021','2018072810256541','50000107382018072805769543127');
$result = $refund->pay();
// if($refund['status'] == 2) {
// echo '订单已完成退款';exit;
// }
var_dump($result);
// if($result['return_code'] == 'SUCCESS' && $result['return_msg'] == 'OK') {
// Db::startTrans();
// $refund_update = [
// 'status' => 2,
// 'refund_time' => strtotime($result['refund_success_time_0'])
// ];
// $refund_result = $refund_model->where(['id'=>$refund['id']])->update($refund_update);
// if(!$refund_result) {
// Db::rollback();
// echo '退款状态修改失败';exit;
// }
// $order_model = new OrderModel();
// $order_update = [
// 'status' => 4,
// 'refund_time' => strtotime($result['refund_success_time_0'])
// ];
// $order_result = $order_model->where(['id'=>$refund['order_id']])->update($order_update);
// if(!$order_result) {
// Db::rollback();
// echo '订单状态修改失败';exit;
// }
// Db::commit();
// } else {
// $refund_update = [
// 'status' => 5,
// 'remark' => $result['return_msg']
// ];
// $refund_result = $refund_model->where(['id'=>$refund['id']])->update($refund_update);
// if(!$refund_result) {
// echo '退款状态修改失败';exit;
// }
// return false;
// }
// var_dump($result);
}
public function callback() {
// echo url('portal/Notify/refund_notify', '', '', true);
$info = Db::name('Test')->where(['id'=>144])->find();
$data = json_decode($info['data'],true);
if($data['return_code'] == 'SUCCESS' && !empty($data['req_info'])) {
$key = md5(Config::get('wx_key'));
$array = $this->xmlToArray($this->refund_decrypt($data['req_info'],$key));
var_dump($array);
$refund_where = [
'order_sn' => $array['out_refund_no'],
'refund_id' => $array['refund_id'],
];
$order_where = [
'transaction_id' => $array['transaction_id'],
];
$handle_sql = true;
// Db::startTrans();
if($array['refund_status'] == 'SUCCESS') {
$refund_update = [
'status' => 2,
'refund_time' => strtotime($array['success_time']),
'remark' => $array['refund_account'],
'more' => json_encode($array),
];
$refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);
$order_update = [
'status' => 4,
'refund_time' => $array['success_time']
];
$order_result = Db::name('Order')->where($order_where)->update($order_update);
if(!$refund_result || !$order_result) {
$handle_sql = false;
}
} elseif($array['refund_status'] == 'CHANGE') {
$refund_update = [
'status' => 4,
// 'refund_time' => strtotime($array['success_time']),
// 'remark' => $array['refund_account'],
'more' => json_encode($array),
];
$refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);
if(!$refund_result) {
$handle_sql = false;
}
} elseif($array['refund_status'] == 'REFUNDCLOSE') {
$refund_update = [
'status' => 3,
// 'refund_time' => strtotime($array['success_time']),
// 'remark' => $array['refund_account'],
'more' => json_encode($array),
];
$refund_result = Db::name('Refund')->where($refund_where)->update($refund_update);
if(!$refund_result) {
$handle_sql = false;
}
}
if(!$handle_sql) {
// Db::rollback();
} else {
// Db::commit();
// $this->return_success();
}
}
}
public function refund_decrypt($str, $key) {
$str = base64_decode($str);
$decrypted = openssl_decrypt($str, 'AES-256-ECB', $key, OPENSSL_RAW_DATA);
return $decrypted;
}
public function refund_alipay() {
$orderInfo = Db::name('Order')->where(['id'=>217])->find();
$orderInfo['user_type'] = 1;
$re = Db::name('Refund')->where(['id'=>265])->find();
$result = json_decode($re['more']);
$refund_model = new RefundModel();
if($result->code == '10000' && $result->msg == 'Success') {
$insert = [
'order_id' => $orderInfo['id'],
'order_sn' => $result->out_trade_no,
'user_id' => $orderInfo['user_id'],
'user_type' => $orderInfo['user_type'],
'refund_id' => $result->trade_no,
'money' => $orderInfo['money'],
'pay_type' => 2,
'status' => 2,
'reason' => 1,
'create_time' => time(),
'update_time' => time(),
'refund_time' => strtotime($result->gmt_refund_pay),
'more' => json_encode($result)
];
$refund_result = $refund_model->insertGetId($insert);
$update = [
'status' => 4,
'refund_time' => strtotime($result->gmt_refund_pay)
];
$order_result = Db::name('Order')->where(['id'=>$orderInfo['id']])->update($update);
if(!$refund_result || !$order_result) {
// return false;
}
// return true;
}
}
//xml转换成数组
private function xmlToArray($xml) {
//禁止引用外部xml实体
libxml_disable_entity_loader(true);
$xmlstring = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
$val = json_decode(json_encode($xmlstring), true);
return $val;
}
/**
* 对密文进行解密
... ...