完善第一个发布版本

This commit is contained in:
hdm 2021-02-25 01:06:21 +08:00
parent 4e4039cc59
commit eed0412fec
12 changed files with 28 additions and 25 deletions

View File

@ -107,7 +107,7 @@ class Database extends BaseController
}
// 执行还原数据库操作
public function import(string $id)
public function import(int $id)
{
$list = $this->db->getFile('timeverif', $id);
$this->db->setFile($list)->import(1);
@ -120,12 +120,12 @@ class Database extends BaseController
$file_name = $name; //得到文件名
header("Content-type:text/html;charset=utf-8");
$file_name = iconv("utf-8","gb2312",$file_name); // 转换编码
$file_sub_path = CMS_ROOT . '/public'.$this->config['path']; //确保文件在这个路径下面,换成你文件所在的路径
$file_sub_path = $this->config['path']; //确保文件在这个路径下面,换成你文件所在的路径
$file_path = $file_sub_path . $file_name;
# 将反斜杠 替换成正斜杠
$file_path = str_replace('\\','/',$file_path);
if(!file_exists($file_path)){
$this->error('下载文件不存在!');exit; //如果提示这个错误,很可能你的路径不对,可以打印$file_sub_path查看
$this->error($file_path);exit; //如果提示这个错误,很可能你的路径不对,可以打印$file_sub_path查看
}
$fp = fopen($file_path,"r"); // 以可读的方式打开这个文件
# 如果出现图片无法打开,可以在这个位置添加函数

View File

@ -21,9 +21,14 @@ class Index extends BaseController
$adminCount=Db::name('admin')->where('status','1')->count();
$userCount=Db::name('user')->where('status','1')->count();
$articleCount=Db::name('article')->where('status','1')->count();
$install=false;
if (file_exists(CMS_ROOT . 'app/install')) {
$install=true;
}
View::assign('adminCount', $adminCount);
View::assign('userCount', $userCount);
View::assign('articleCount', $articleCount);
View::assign('install', $install);
return View();
}

View File

@ -8,7 +8,7 @@ class Install
public function handle($request, \Closure $next)
{
if (!is_installed()) {
return $request->isAjax()?vae_assign(202,'请先完成系统安装引导'):redirect((string)url('/install/index'));
return $request->isAjax()?to_assign(0,'请先完成系统安装引导'):redirect((string)url('/install/index'));
}
return $next($request);
}

View File

@ -13,9 +13,7 @@ class AdminLog extends Model
public function get_title($type)
{
$type_array=[
'Conf/web_submit'=>'网站信息',
'Conf/email_submit'=>'邮箱配置',
'Conf/wechat_submit'=>'微信配置',
'Conf/conf_submit'=>'配置信息',
'Menu/post_submit'=>'菜单',
'Menu/delete'=>'菜单',
'Rule/post_submit'=>'节点',

View File

@ -13,7 +13,7 @@
if(readonly=='true'){
read=true;
}
var toolbar=['fullscreen', 'source', 'undo', 'redo','|','fontsize','bold', 'italic', 'underline','forecolor', 'strikethrough', 'superscript', 'subscript','|', 'removeformat', 'formatmatch', 'autotypeset', 'pasteplain','link','unlink','|','justifyleft','justifycenter','justifyright','justifyjustify','|', 'insertorderedlist', 'insertunorderedlist','simpleupload', 'insertimage', 'inserttable', 'selectall', 'cleardoc'];
var toolbar=['fullscreen', 'source', 'undo', 'redo','|','fontsize','bold', 'italic', 'underline','forecolor', 'strikethrough', 'superscript', 'subscript','|', 'removeformat', 'formatmatch', 'insertcode', 'pasteplain','link','unlink','|','justifyleft','justifycenter','justifyright','justifyjustify','|', 'insertorderedlist', 'insertunorderedlist','simpleupload', 'insertimage', 'inserttable', 'selectall', 'cleardoc'];
if(toolbarArray && toolbarArray.length>0){
toolbar=toolbarArray;
}

View File

@ -123,6 +123,11 @@
<div class="panel-right">
<div class="table-title">系统信息</div>
<table class="layui-table" lay-skin="" lay-size="sm">
{if condition="($install == true)"}
<tr>
<td colspan="2" style="color: #E94335;">提醒发现app目录下的install文件夹没删除为了系统的安全,请手动去删除。</td>
</tr>
{/if}
<tr>
<td><b>服务器系统</b></td>
<td>{:get_system_info('os')}</td>

View File

@ -8,7 +8,7 @@ class Install
public function handle($request, \Closure $next)
{
if (!is_installed()) {
return $request->isAjax()?vae_assign(202,'请先完成系统安装引导'):redirect((string)url('/install/index'));
return $request->isAjax()?to_assign(0,'请先完成系统安装引导'):redirect((string)url('/install/index'));
}
return $next($request);

View File

@ -135,16 +135,6 @@
email = $('[name="email"]').val(),
mobile = $('[name="mobile"]').val();
$.ajax({
url: "http://i.slambase.cn:8081/v1/user",
data: "{'user_id':'ceshi'}",
type: 'post',
contentType: "application/json;charset=UTF-8",//指定消息请求类型
success: function (res) {
console.log(res);
}
})
return false;
if (truename == '') {
layer.msg('真实姓名不能为空');
return;

View File

@ -520,6 +520,7 @@ CREATE TABLE `cms_user` (
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态 -1删除 0禁用 1正常 ',
`last_login_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`last_login_ip` varchar(20) NOT NULL DEFAULT '' COMMENT '最后登录IP',
`login_num` int(11) NOT NULL DEFAULT '0',
`register_time` int(11) NOT NULL DEFAULT '0' COMMENT '注册时间',
`register_ip` varchar(20) NOT NULL DEFAULT '' COMMENT '注册IP',
`wx_platform` int(11) NOT NULL DEFAULT 0 COMMENT '首次注册来自于哪个微信平台',
@ -529,6 +530,7 @@ CREATE TABLE `cms_user` (
-- ----------------------------
-- Table structure for `cms_user_log`
-- ----------------------------
DROP TABLE IF EXISTS `cms_user_log`;
CREATE TABLE `cms_user_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`uid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
@ -543,7 +545,7 @@ CREATE TABLE `cms_user_log` (
`param_id` int(11) unsigned NOT NULL COMMENT '操作ID',
`param` text COMMENT '参数json格式',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0删除 1正常',
`create_time` int(11) NOT NULL DEFAULT '0' '创建时间',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户操作日志表';

View File

@ -35,8 +35,8 @@
</ul>
</div>
<div style="padding:20px; background-color:#fff;line-height: 27px; border-radius:0 0 6px 6px">
<h3>数据库配置</h3><br>
<form class="layui-form" action="" id="form">
<h3>数据库配置</h3><br>
<div class="layui-form-item">
<label class="layui-form-label">数据库类型</label>
<div class="layui-input-inline">
@ -129,7 +129,7 @@
</div>
</div>
</form>
<div style="display: none;text-align: center;" id="complete">
<div style="display: none; padding: 20px 0; text-align: center;" id="complete">
<h1>安装完成!</h1><br><br><br>
<a href="/" class="layui-btn layui-bg-cyan">访问首页</a>
<a href="/admin/index" class="layui-btn layui-bg-green">访问后台</a>

View File

@ -25,7 +25,10 @@ class MDAvatars
$this->LetterFont = dirname(__FILE__) . '/fonts/SourceCodePro-Light.ttf';
$this->AsianFont = dirname(__FILE__) . '/fonts/SourceHanSansCN-Normal.ttf';
$this->EnableAsianChar = is_file($this->AsianFont);
$path='./storage/avatars/';
if(!is_dir($path)){
mkdir($path, 0755, true);
}
$CNChar = ord($this->Char);
if (!$this->EnableAsianChar &&
preg_match("/^[\x7f-\xff]/", $this->Char) &&

View File

@ -17,11 +17,11 @@
.ittab-menulist-top a:last-child {border-radius: 0 3px 3px 0;}
.ittab-menulist-top a:hover{opacity: .9;}
.ittab-menulist-1 li{height:48px; line-height:48px; cursor:pointer; list-style:none;}
.ittab-menulist-1 li{height:44px; line-height:44px; cursor:pointer; list-style:none;}
.ittab-menulist-2 {height:48px;line-height:48px;position:relative;padding-left:12px; cursor: pointer;}
.ittab-menulist-1 li:hover,.ittab-menulist-2:hover {background-color: rgba(255,255,255,.1)}
.ittab-menulist-1 .iconfont{font-size: 16px;}
.ittab-menulist-1 .site-menu-active span{padding-left:32px; border-left: 4px solid#131E25; width: 164px; display: inline-block;}
.ittab-menulist-1 .site-menu-active span{padding-left:29px; border-left: 3px solid#131E25; width: 168px; display: inline-block;}
.ittab-menulist-1 li:hover span{border-color: rgba(255,255,255,.1)}
.ittab-menulist-1 li.layui-this span{border-color:#E94335 !important; color:#fff !important; background-color: rgba(255,255,255,.1);}
.ittab-menulist-1 li .layui-icon-triangle-r{float:right; margin-right:16px;}