Browse Source

修复弹出窗出现滚动条的BUG
优化插件安装时的错误提示
优化附件管理上传中的文字
优化fastadmin.sql的基础数据
优化后台添加规则的提示
优化Frontend.php的逻辑
优化前台首页第三方资源的加载
更新版本号

Karson 8 years ago
parent
commit
3b295553a6

+ 4 - 1
application/admin/command/Addon.php

@@ -40,7 +40,10 @@ class Addon extends Command
         {
             throw new Exception('Please input correct action name');
         }
-
+        
+        // 查询一次SQL,判断连接是否正常
+        Db::execute("SELECT 1");
+        
         $addonDir = ADDON_PATH . $name;
         switch ($action)
         {

+ 1 - 0
application/admin/command/Install.php

@@ -51,6 +51,7 @@ class Install extends Command
         Db::getPdo()->exec($sql);
 
         file_put_contents($installLockFile, 1);
+        
         $output->info("Install Successed!");
     }
 

File diff suppressed because it is too large
+ 2 - 2
application/admin/command/Install/fastadmin.sql


+ 1 - 0
application/admin/lang/zh-cn/auth/rule.php

@@ -7,6 +7,7 @@ return [
     'Icon'                                                 => '图标',
     'Alert'                                                => '警告',
     'Name'                                                 => '规则URL',
+    'Controller/Action'                                    => '控制器名/方法名',
     'Ismenu'                                               => '菜单',
     'The non-menu rule must have parent'                   => '非菜单规则节点必须有父级',
     'If not necessary, use the command line to build rule' => '非必要情况下请直接使用命令行php think menu来生成',

+ 15 - 13
application/admin/lang/zh-cn/general/attachment.php

@@ -1,17 +1,19 @@
 <?php
 
 return [
-    'Url'                  => '物理路径',
-    'Imagewidth'           => '宽度',
-    'Imageheight'          => '宽度',
-    'Imagetype'            => '图片类型',
-    'Imageframes'          => '图片帧数',
-    'Preview'              => '预览',
-    'Filesize'             => '文件大小',
-    'Mimetype'             => 'Mime类型',
-    'Extparam'             => '透传数据',
-    'Createtime'           => '创建日期',
-    'Uploadtime'           => '上传时间',
-    'Storage'              => '存储引擎',
-    'Upload by summernote' => '从编辑器上传'
+    'Url'                => '物理路径',
+    'Imagewidth'         => '宽度',
+    'Imageheight'        => '宽度',
+    'Imagetype'          => '图片类型',
+    'Imageframes'        => '图片帧数',
+    'Preview'            => '预览',
+    'Filesize'           => '文件大小',
+    'Mimetype'           => 'Mime类型',
+    'Extparam'           => '透传数据',
+    'Createtime'         => '创建日期',
+    'Uploadtime'         => '上传时间',
+    'Storage'            => '存储引擎',
+    'Upload to third'    => '上传到第三方',
+    'Upload to local'    => '上传到本地',
+    'Upload from editor' => '从编辑器上传'
 ];

+ 1 - 1
application/admin/view/auth/rule/add.html

@@ -18,7 +18,7 @@
     <div class="form-group">
         <label for="name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" class="form-control" id="name" name="row[name]" value="" data-rule="required" />
+            <input type="text" class="form-control" id="name" name="row[name]" placeholder="{:__('Controller/Action')}" value="" data-rule="required" />
         </div>
     </div>
     <div class="form-group">

+ 1 - 1
application/admin/view/auth/rule/edit.html

@@ -14,7 +14,7 @@
     <div class="form-group">
         <label for="name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" class="form-control" id="name" name="row[name]" value="{$row.name}" data-rule="required" />
+            <input type="text" class="form-control" id="name" name="row[name]" placeholder="{:__('Controller/Action')}" value="{$row.name}" data-rule="required" />
         </div>
     </div>
     <div class="form-group">

+ 8 - 6
application/admin/view/general/attachment/add.html

@@ -1,17 +1,19 @@
 <form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
+    {if $config.upload.cdnurl}
     <div class="form-group">
-        <label for="c-upyun" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
+        <label for="c-third" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input type="text" name="row[upyun]" id="c-upyun" class="form-control" />
+            <input type="text" name="row[third]" id="c-third" class="form-control" />
         </div>
     </div>
 
     <div class="form-group">
-        <label for="c-upyun" class="control-label col-xs-12 col-sm-2"></label>
+        <label for="c-third" class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
-            <button id="plupload-upyun" class="btn btn-danger plupload" data-input-id="c-upyun" ><i class="fa fa-upload"></i> {:__("Upload to upyun")}</button>
+            <button id="plupload-third" class="btn btn-danger plupload" data-input-id="c-third" ><i class="fa fa-upload"></i> {:__("Upload to third")}</button>
         </div>
     </div>
+    {/if}
 
     <div class="form-group">
         <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
@@ -28,9 +30,9 @@
     </div>
 
     <div class="form-group">
-        <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload by summernote')}:</label>
+        <label for="c-editor" class="control-label col-xs-12 col-sm-2">{:__('Upload from editor')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <textarea name="row[summernote]" id="c-summernote" cols="60" rows="5" class="summernote"></textarea>
+            <textarea name="row[editor]" id="c-editor" cols="60" rows="5" class="form-control editor"></textarea>
         </div>
     </div>
     <div class="form-group hidden layer-footer">

+ 0 - 27
application/common/controller/Frontend.php

@@ -2,28 +2,14 @@
 
 namespace app\common\controller;
 
-use app\common\library\Auth;
 use think\Config;
 use think\Controller;
 use think\Lang;
-use think\Session;
 
 class Frontend extends Controller
 {
 
     /**
-     *
-     * @var Auth
-     */
-    protected $user = null;
-
-    /**
-     * 无需登录的方法,默认全部都无需登录
-     * @var array
-     */
-    protected $noNeedLogin = ['*'];
-
-    /**
      * 布局模板
      * @var string
      */
@@ -37,8 +23,6 @@ class Frontend extends Controller
         $controllername = strtolower($this->request->controller());
         $actionname = strtolower($this->request->action());
 
-        $path = '/' . $modulename . '/' . str_replace('.', '/', $controllername) . '/' . $actionname;
-
         // 如果有使用模板布局
         if ($this->layout)
         {
@@ -66,17 +50,6 @@ class Frontend extends Controller
         $this->assign('config', $config);
     }
 
-    protected function checkLogin()
-    {
-        //检测是否登录
-        if (!$this->user->isLogin())
-        {
-            $url = Session::get('referer');
-            $url = $url ? $url : $this->request->url();
-            $this->error(__('Please login first'), url('/user/login', ['url' => $url]));
-        }
-    }
-
     /**
      * 加载语言文件
      * @param string $name

+ 2 - 1
application/common/library/Menu.php

@@ -4,6 +4,7 @@ namespace app\common\library;
 
 use app\admin\model\AuthRule;
 use fast\Tree;
+use think\Exception;
 use think\exception\PDOException;
 
 class Menu
@@ -46,7 +47,7 @@ class Menu
             }
             catch (PDOException $e)
             {
-                print_r($e);
+                throw new Exception($e->getMessage());
             }
         }
     }

+ 1 - 1
application/config.php

@@ -242,7 +242,7 @@ return [
     ],
     //FastAdmin配置
     'fastadmin'              => [
-        'version'   => '1.0.0.20170808_beta',
+        'version'   => '1.0.0.20170816_beta',
         'api_url'   => 'http://api.fastadmin.net',
     ],
 ];

+ 0 - 5
application/index/view/index/index.html

@@ -15,11 +15,6 @@
         <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
         <link href="/assets/css/index.css" rel="stylesheet">
 
-        <!-- Custom Fonts -->
-        <link href="https://fonts.lug.ustc.edu.cn/css?family=Lato" rel="stylesheet">
-        <link href="https://fonts.lug.ustc.edu.cn/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
-        <link href="https://fonts.lug.ustc.edu.cn/css?family=Muli" rel="stylesheet">
-
         <!-- Plugin CSS -->
         <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
         <link href="//cdn.bootcss.com/simple-line-icons/2.4.1/css/simple-line-icons.min.css" rel="stylesheet">

+ 3 - 0
public/assets/css/backend.css

@@ -595,6 +595,9 @@ table.table-template {
   border: none!important;
   box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important;
 }
+.layui-layer-fast.layui-layer-iframe {
+  overflow: hidden!important;
+}
 .layui-layer-fast .layui-layer-moves {
   -webkit-box-sizing: content-box;
   -moz-box-sizing: content-box;

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/backend.min.css


+ 3 - 0
public/assets/less/backend.less

@@ -620,6 +620,9 @@ table.table-template{
         border:none!important;
         box-shadow: 1px 1px 50px rgba(0,0,0,.3)!important;
     }
+    &.layui-layer-iframe {
+        overflow:hidden!important;
+    }
     .layui-layer-moves{
         .box-sizing(content-box);
     }