From d946353c5c680154075e87946454113acc8fd330 Mon Sep 17 00:00:00 2001 From: wispx <1591788658@qq.com> Date: Wed, 2 Jan 2019 16:38:49 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=BF=BD=E7=95=A5.env=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ---- .gitignore | 1 + config/app.php | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 6acdc4bd..00000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -[APP] -NAME = Lsky Pro -DEBUG = false -TRACE = false diff --git a/.gitignore b/.gitignore index eb7a8180..689d3ce8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ runtime /config/db.php +.env # Icon must end with two \r Icon diff --git a/config/app.php b/config/app.php index 3935997d..61dc0dd6 100644 --- a/config/app.php +++ b/config/app.php @@ -15,7 +15,7 @@ return [ // 应用名称 - 'app_name' => Env::get('app.name'), + 'app_name' => Env::get('app.name', 'Lsky Pro'), // 应用地址 'app_host' => '', // 应用调试模式 From ce128313a838ae39dd27e761388c2652931c9d4d Mon Sep 17 00:00:00 2001 From: wispx <1591788658@qq.com> Date: Wed, 2 Jan 2019 17:35:32 +0800 Subject: [PATCH 02/11] up md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9c0b7c84..cae88179 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ [官网](https://www.lsky.pro) [手册](https://www.kancloud.cn/wispx/lsky-pro) -[![License](https://img.shields.io/badge/license-GPL_V3.0-yellowgreen.svg?style=flat-square)](https://github.com/wisp-x/lsky-pro/blob/master/LICENSE) -[![PHP](https://img.shields.io/badge/PHP->=5.6-orange.svg?style=flat-square)](http://php.net) -[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/wisp-x/lsky-pro.svg?style=flat-square)](https://github.com/wisp-x/lsky-pro) -[![Join the chat at https://gitter.im/wisp-x/lsky-pro](https://badges.gitter.im/wisp-x/lsky-pro.svg)](https://gitter.im/wisp-x/lsky-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge&style=flat-square) +[![License](https://img.shields.io/badge/license-GPL_V3.0-yellowgreen.svg)](https://github.com/wisp-x/lsky-pro/blob/master/LICENSE) +[![PHP](https://img.shields.io/badge/PHP->=5.6-orange.svg)](http://php.net) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/wisp-x/lsky-pro.svg)](https://github.com/wisp-x/lsky-pro) +[![Join the chat at https://gitter.im/wisp-x/lsky-pro](https://badges.gitter.im/wisp-x/lsky-pro.svg)](https://gitter.im/wisp-x/lsky-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) > master分支为最新版,其他版本请点击[这里](https://github.com/wisp-x/lsky-pro/releases) From 7efbd8abb4aa4492f95832e31280209b0a8942a2 Mon Sep 17 00:00:00 2001 From: wispx <1591788658@qq.com> Date: Thu, 3 Jan 2019 12:02:36 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Install.php | 2 +- application/index/view/install/update.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/index/controller/Install.php b/application/index/controller/Install.php index 1a5c942d..1cf6ec48 100644 --- a/application/index/controller/Install.php +++ b/application/index/controller/Install.php @@ -245,7 +245,7 @@ EOT; foreach (explode(';', $file) as $value) { if ($value && !ctype_space($value)) { if (!$mysqli->query($value . ';')) { - throw new Exception('数据导入失败,错误信息:' . $mysqli->error . ',sql语句:' . $value); + throw new Exception('

数据导入失败!

错误信息:
' . $mysqli->error . '

sql语句:
' . $value . '

'); } } } diff --git a/application/index/view/install/update.html b/application/index/view/install/update.html index a1fda2dc..4551795e 100644 --- a/application/index/view/install/update.html +++ b/application/index/view/install/update.html @@ -34,7 +34,7 @@

- 数据库结构更新准备就绪

{if $msg} -

{$msg|raw}

+
{$msg|raw}
{/if} {if $code eq 0}
From 8fe1190da5c0a321aecf4d9cb9162849bed427a5 Mon Sep 17 00:00:00 2001 From: wispx <1591788658@qq.com> Date: Sat, 19 Jan 2019 09:25:11 +0800 Subject: [PATCH 04/11] =?UTF-8?q?-=20=E7=A7=BB=E9=99=A4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=90=8E=E6=B8=85=E7=A9=BA=E5=9B=BE=E7=89=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=20-=20=E9=A6=96=E9=A1=B5=E5=A2=9E=E5=8A=A0"=E6=9C=AC=E7=AB=99?= =?UTF-8?q?=E5=B7=B2=E6=89=98=E7=AE=A1N=E5=BC=A0=E5=9B=BE=E7=89=87"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Base.php | 2 +- application/index/controller/Index.php | 3 +++ application/index/view/common/base.html | 4 ++-- application/index/view/index/index.html | 11 +++++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/application/index/controller/Base.php b/application/index/controller/Base.php index c273499c..c941dad5 100644 --- a/application/index/controller/Base.php +++ b/application/index/controller/Base.php @@ -55,7 +55,7 @@ class Base extends Controller } // 检测数据库结构更新 - if ($this->user && $this->user->is_admin) { + if ($this->user && $this->user->is_admin && !\config('app.app_debug')) { if (file_exists(Env::get('root_path') . 'update.sql')) { $this->redirect(url('/install/update')); } diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 005cc557..eafb759b 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -8,10 +8,13 @@ namespace app\index\controller; +use app\common\model\Images; + class Index extends Base { public function index() { + $this->assign('images_count', Images::cache(120)->count()); return $this->fetch(); } diff --git a/application/index/view/common/base.html b/application/index/view/common/base.html index 7075925e..7aab1358 100644 --- a/application/index/view/common/base.html +++ b/application/index/view/common/base.html @@ -1,5 +1,5 @@ - + @@ -130,7 +130,7 @@