huwhois преди 5 месеца
родител
ревизия
d2b35f5639

+ 32 - 78
app/controller/Article.php

@@ -16,8 +16,6 @@ use think\exception\HttpException;
 
 use app\model\Category as CategoryModel;
 use app\model\Article as ArticleModel;
-use app\model\ArticleBrowerHistory;
-use app\model\ArticleTags as ArticleTagsModel;
 use app\model\ArticleDolikeLog;
 use app\model\Tag;
 use app\model\TagArticle;
@@ -36,31 +34,12 @@ class Article extends Base
 
         $list = ArticleModel::queryPage($params);
 
-        $category = CategoryModel::find($params['cid']);
-
-        if ($category) {
-            $baseUrl = $category->url;
-        } else {
-            $baseUrl = '/index/all';
-        }
-
         View::assign([
-            'baseUrl'  => $baseUrl,
-            'list' => $list->all(),
-            'total' => $list->total(),
-            'limit' => $list->listRows(),
-            'page' => $list->currentPage(),
-            'lastPage' => $list->lastPage(),
-            'pagelist' => $list->render(),
-            'cid' => $params['cid'],
+            'list' => $list,
+            'cid' => $params['cid']
         ]);
 
-        $html = View::fetch();
-        // if ($this->html) {
-        //     $this->makeHtmlFile($html);
-        // }
-
-        return $html;
+        return View::fetch();
     }
 
     /**
@@ -74,30 +53,6 @@ class Article extends Base
             throw new HttpException(404, '页面不存在');
         }
 
-        $ip = $this->request->ip();
-        $time = time();
-        $abh = ArticleBrowerHistory::getByIpAid($ip, $id);
-
-        if (!$abh) {
-            $data->hits += 1;
-            
-            $data->isAutoWriteTimestamp(false)->save();
-
-            ArticleBrowerHistory::create([
-                'ip' => $ip,
-                'aid'=> $id,
-                'create_time' => $time
-            ]);
-        } else {
-            $createTime = $abh->create_time;
-
-            if ($createTime + 24*3600 < $time) {
-                $data->hits += 1;
-            
-                $data->isAutoWriteTimestamp(false)->save();
-            }
-        }
-
         $prev_next = ArticleModel::getNextPrev($id, $data->cid);
 
         if ($data->content_type == 1) {
@@ -117,9 +72,7 @@ class Article extends Base
         $this->seo['des'] = $data->summary;
         View::assign('seo',  $this->seo);
 
-        $html = View::fetch();
-
-        return $html;
+        return View::fetch();
     }
 
     /**
@@ -167,7 +120,7 @@ class Article extends Base
             throw new HttpException(404, '标签不存在');
         }
 
-        $list = TagArticle::queryList($tag->tid);
+        $list = TagArticle::queryList($tag->id);
 
         View::assign([
             'list' => $list,
@@ -182,30 +135,21 @@ class Article extends Base
      */
     public function archive($year = 0, $month = 0)
     {
-        $yearMonth = $year . '-' . $month;
-
         if ($year == 0 || $month == 0) {
             throw new HttpException(404, '日期格式不正确');
         }
+        $yearMonth = $year . '-' . $month;
+
+        $params = $this->app->request->param();
 
-        $list = ArticleModel::queryPage(['yearMonth' => $yearMonth]);
+        $list = ArticleModel::queryPage($params);
 
         View::assign([
-            'list' => $list->all(),
-            'total' => $list->total(),
-            'limit' => $list->listRows(),
-            'page' => $list->currentPage(),
-            'lastPage' => $list->lastPage(),
-            'pagelist' => $list->render(),
+            'list' => $list,
             'yearMonth'  => $yearMonth
         ]);
 
-        $html = View::fetch();
-        // if ($this->html) {
-        //     $this->makeHtmlFile($html);
-        // }
-
-        return $html;
+        return View::fetch();
     }
 
     /**
@@ -213,20 +157,30 @@ class Article extends Base
      */
     public function time()
     {
-        $params = ['order' => 'update_time desc'];
+        $params = $this->app->request->param();
+
         $list = ArticleModel::queryPage($params);
 
-        View::assign([
-            'list' => $list->all(),
-            'total' => $list->total(),
-            'limit' => $list->listRows(),
-            'page' => $list->currentPage(),
-            'lastPage' => $list->lastPage(),
-            'pagelist' => $list->render(),
-        ]);
+        View::assign('list', $list);
 
-        $html = View::fetch();
+        return View::fetch();
+    }
 
-        return $html;
+    /**
+     * 文章搜索
+     */
+    public function search()
+    {
+        $key = $this->app->request->has('key') ? $this->app->request->param('key') : "";
+        
+        if ($key != "") {
+            $params = $this->app->request->param();
+            $list = ArticleModel::queryPage($params);
+            View::assign('list', $list);
+        }
+
+        View::assign("key", $key);
+
+        return View::fetch();
     }
 }

+ 2 - 4
app/controller/Base.php

@@ -12,10 +12,8 @@ namespace app\controller;
 
 use app\BaseController;
 use think\facade\View;
-use think\facade\Config;
 use think\App;
 
-use app\model\Article;
 use app\model\Category;
 use think\facade\Env;
 
@@ -64,11 +62,11 @@ class Base extends BaseController
         }
 
         // 栏目菜单(nav)
-        $categories = Category::getList(['is_nav'=>1]);
+        $categories = Category::getList(['is_nav'=>0]);
         View::assign('categories', $categories);
         
         // 一般栏目
-        $cate_lists = Category::getList(['type'=>1]);
+        $cate_lists = Category::getList(['type'=>0]);
         View::assign('cate_lists', $cate_lists);
     }
 }

+ 3 - 12
app/controller/Index.php

@@ -16,6 +16,7 @@ use think\facade\View;
 use app\controller\Base;
 use app\model\Article;
 use app\model\GuestBook;
+use app\utils\ReUtils;
 
 class Index extends Base
 {
@@ -32,14 +33,6 @@ class Index extends Base
         return View::fetch();
     }
 
-    public function guestBook()
-    {
-        $list = GuestBook::order('id desc')->paginate();
-        View::assign('list', $list);
-
-        return View::fetch();
-    }
-
     public function saveGuestBook()
     {
         $param = $this->request->param('', '', ['strip_tags', 'htmlspecialchars']);
@@ -62,11 +55,9 @@ class Index extends Base
                 'time' => time(),
             ]);
             $bgu->datetime = date("Y-m-d", $bgu->time);
-            return json(['msg' => "保存成功", 'code' => 0, 'data' => $bgu]);
+            return ReUtils::result($bgu);
         } catch (\Exception $e) {
-            $msg = $e->getMessage();
-
-            return json(['msg' => $msg, 'code' => 1]);
+            return ReUtils::error($e->getMessage());
         }
     }
 }

+ 6 - 0
app/model/Article.php

@@ -83,6 +83,12 @@ class Article extends Base
             $where[] = ['create_time','between', [$days['firstday'], $days['lastday']]];
         }
 
+        if (!empty($params['year']) && !empty($params['month'])) {
+            $days = month_frist_and_last_day($params['year'], $params['month']);
+
+            $where[] = ['create_time','between', [$days['firstday'], $days['lastday']]];
+        }
+
         $limit = empty($params['limit']) ? Config::get('app.page_size', 20) : (int)$params['limit'];
         
         $order = ['id desc'];

+ 1 - 3
app/model/Category.php

@@ -14,8 +14,6 @@ class Category extends Base
         "name"        => "varchar",
         "url"         => "varchar",
         "route"       => "varchar",
-        "tablename"   => "varchar",
-        "template"    => "varchar",
         "type"        => "int",
         "is_nav"      => "int",
         "remark"       => "varchar",
@@ -44,7 +42,7 @@ class Category extends Base
 
         $order = isset($param['order']) ? (string) $param['order'] : "sort ASC,id DESC";
 
-        return self::where($where)->field("id,parent_id,name,url,route,tablename,template,type,is_nav,remark,sort,title,keywords,
+        return self::where($where)->field("id,parent_id,name,url,route,type,is_nav,remark,sort,title,keywords,
             description,is_blank,create_time,update_time")->order($order)->select();
     }
 

+ 2 - 5
app/model/TagArticle.php

@@ -5,7 +5,6 @@ declare(strict_types=1);
 namespace app\model;
 
 use think\facade\Db;
-use think\facade\Config;
 
 use app\model\Base;
 use app\model\Tag;
@@ -25,7 +24,7 @@ class TagArticle extends Base
 
     public function article()
     {
-        return $this->belongsTo('Article', 'aid')->bind(['id', 'title', 'titlepic', 'summary', 'hits', 'create_time', 'username']);
+        return $this->belongsTo('Article', 'aid')->bind(['title', 'titlepic', 'summary', 'hits', 'create_time', 'username']);
     }
 
     public function category()
@@ -35,9 +34,7 @@ class TagArticle extends Base
 
     public static function queryList($tagid)
     {
-        $limit = (int) Config::get('app.page_size', 20);
-
-        return self::with(['article', 'category'])->where('tid', $tagid)->order('aid DESC')->limit($limit)->paginate();
+        return self::with(['article', 'category'])->where('tid', $tagid)->order('aid DESC')->paginate();
     }
 
     public static function saveArticleTag(array $tags, int $aid, int $cid)

+ 25 - 2
public/static/css/index.css

@@ -71,7 +71,7 @@ aside { width: 32%; float: right }
 .paihang ul li { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; line-height: 26px }
 footer { width: 100%; text-align: center; background: #FFF; padding: 10px 0; line-height: 26px; border-top: #333 1px solid; }
 /*list*/
-.place { margin: 10px 0; width: 100%; overflow: hidden; background: #fff; }
+.place { margin: 10px 0;padding: 30px 20px; width: 100%; overflow: hidden; background: #fff; }
 .place a { display: block; float: left; padding: 5px 0; background: #fff; margin: 0 10px; width: 100px; text-align: center }
 .pagelist { text-align: center; color: #666; width: 100%; clear: both; margin: 25px 0 10px 0; padding-top: 20px }
 .pagelist a { color: #666; margin: 0 2px 10px; border: 1px solid #fff; padding: 5px 10px; background: #FFF; display: inline-block; }
@@ -178,7 +178,30 @@ code:not(.language-plaintext,.language-php,.language-c,.language-js,.language-ja
     background-color: #f9f2f4;
 }
 
+.search_place {
+    margin: 10px 0;padding: 30px 20px; width: 100%; overflow: hidden; background: #fff; 
+}
+.search_place input.input-key {
+    width: 66%;
+    padding: 4px;
+    height: 36px;
+    line-height: 36px;
+    font-size: 18px;
+}
+.search_place input.input-submit {
+    margin-left: 2%;
+    padding: 4px;
+    width: 14%;
+    height: 48px;
+    line-height: 48px;
+    font-size: 18px;
+}
+
+
 /* 分页 */
+div.page {
+    text-align: center;
+}
 .pagination {
     display: inline-block;
     padding-left: 0;
@@ -206,7 +229,7 @@ li.disabled {
 }
 
 .pagination li a {
-    color: #3399d5;
+    color: #000;
 }
 
 .pagination li:first-child {

+ 18 - 13
route/app.php

@@ -10,7 +10,6 @@
 // +----------------------------------------------------------------------
 use think\facade\Route;
 use app\model\Category;
-use think\facade\Template;
 use app\model\SysMenu;
 
 Route::pattern([
@@ -23,21 +22,27 @@ Route::pattern([
     'day' => '\d+',
 ]); 
 
-Route::get('/index', 'index/index/index');
-Route::get('/', 'index/index/index');
+Route::get('/index', 'index/index');
+Route::get('/', 'index/index');
 Route::view('/404', '404');
-Route::get('/about', 'index/index/about')->append(['_aside' => true]);
-Route::get('/guest_book', 'index/index/guestBook');
-Route::post('/save_guest_book', 'index/index/saveGuestBook');
+Route::get('/about', 'index/about')->append(['_aside' => true]);
+Route::get('/guest_book', 'index/guestBook');
+Route::post('/save_guest_book', 'index/saveGuestBook');
 
-Route::get('/tags/:name', 'index/article/tag');
-Route::get('/tag/:name', 'index/article/tag');
-Route::get('/all-<page?>', 'index/article/index')->append(['cid' => 0]);
-Route::post('/dolike', 'index/article/dolike');
-Route::get('/detail/<id>-<name>', 'index/article/read');
-Route::get('/:year/<month>-<day>/:id', 'index/article/read');
-Route::get('/:year/<month>-<page?>', 'index/article/archive');
+Route::get('/search', 'article/search');
+Route::get('/tag/:name', 'article/tag');
+Route::get('/<year>-<month>', 'article/archive');
+Route::get('/:id', 'article/read');
+Route::post('/dolike', 'article/dolike');
 
+$categoryList = Category::field('id, parent_id, name, url, route, type')->select();
+foreach ($categoryList as $category) {
+    if ($category->type == 2) {
+        Route::get($category->url, $category->route);
+    } else {
+        Route::get($category->url, $category->route)->append(['cid'=>$category->id]);
+    }
+}
 
 Route::group('sys', function() {
     Route::get('index', 'sys.index/index');

+ 2 - 2
view/404.html

@@ -47,9 +47,9 @@
   <div class="page-404 text-c" style="margin-top:80px;">
     <p class="error-title"><i class="Hui-iconfont va-m" style="font-size:80px">&#xe656;</i><span class="va-m">
         404</span></p>
-    <p class="error-description">{$e->getMessage() ?? '不好意思,您访问的页面不存在~'}</p>
+    <p class="error-description">'不好意思,您访问的页面不存在~'</p>
     <p class="error-info">
-      您可以:<a href="javascript:;" onclick="history.go(-1)" class="c-primary">&lt; 返回上一页</a>
+      您可以:<a href="javascript:history.back();" onclick="history.go(-1)" class="c-primary">&lt; 返回上一页</a>
       <span class="ml-20">|</span><a href="/" class="c-primary ml-20">去首页 &gt;</a></p>
   </div>
 </body>

+ 3 - 7
view/article/archive.html

@@ -6,7 +6,7 @@
   <div class="blogs">
     {foreach $list as $val}
     <div class="bloglist">
-      <h2><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+      <h2><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
       <div class="bloginfo">
         <ul>
           <li class="author"><a href="{:url($val.category_url)}"> {$val.category_name} </a></li>
@@ -18,12 +18,8 @@
       <p>{$val.summary}</p>
     </div>
     {/foreach}
-    <div class="pagelist">
-      {if $page > 1} <a href="/{:str_replace('-','/',$yearMonth)}-{$page-1}.html">«</a> {/if}
-      {for start="1" end="$lastPage+1"}
-      {if $page == $i} <b>{$i}</b>&nbsp; {else /} <a href="/{:str_replace('-','/',$yearMonth)}-{$i}.html">{$i}</a>&nbsp; {/if}
-      {/for}
-      {if $page < $lastPage} <a href="/{:str_replace('-','/',$yearMonth)}-{$page+1}.html">»</a> {/if}
+    <div class="page">
+      {$list|raw}
     </div>
   </div>
   {include file="aside"}

+ 0 - 84
view/article/article.bak.html

@@ -1,84 +0,0 @@
-<link href="/static/highlight/styles/monokai-sublime.css" rel="stylesheet"> 
-
-<div class="box">
-  <div class="blank"></div>
-  <div class="infosbox">
-    <div class="newsview">
-      <h3 class="news_title">{$data.title}</h3>
-      <div class="bloginfo">
-        <ul>
-          <li class="author"><a href="{:url('/lists/'.$cid.'/1')}"> {$cid|model('admin/blog_category')->getCateName} </a></li>
-          <li class=" timer">{$data.pubtime|date="Y-m-d", ###}</li>
-          <li class="view">{$data.clicks} 已阅读</li>
-          <!-- <li class="like">8888888</li> -->
-        </ul>
-      </div>
-      <!-- <div class="tags"><a href="/" target="_blank">个人博客</a> &nbsp; <a href="/" target="_blank">小世界</a></div> -->
-      <div class="news_about"><strong>简介</strong>{$data.summary}</div>
-      <div class="news_con" id="preview">
-
-      </div>
-      <p id="content_md" style="display: none;">{$data.content_md}</p>
-      <p class="diggit"><a href="JavaScript:getLike({$data.id});"> 很赞哦! </a>(<b id="diggnum"> {$data.like} </b>)</p>
-    </div>
-    <div class="nextinfo">
-      {empty name="prev_next.prev"}
-      <p>上一篇:<a href="#">没有了</a></p>
-      {else}
-      <p>上一篇:<a href="/{$prev_next.prev.pubtime|date='Y/m/d', ###}/{$prev_next['prev']['id']}" title="{$prev_next.prev.title}">{$prev_next.prev.title}</a></p>
-      {/empty}
-      {empty name="prev_next.next"}
-      <p>下一篇:<a href="{:url('/time')}">返回列表</a></p>
-      {else}
-      <p>下一篇:<a
-          href="/{$prev_next.next.pubtime|date='Y/m/d', ###}/{$prev_next['next']['id']}"
-          title="{$prev_next.next.title}">{$prev_next.next.title}</a></p>
-      {/empty}
-    </div>
-    <!-- <div class="otherlink">
-      <h2>相关文章</h2>
-      <ul>
-        <li><a href="#" title="##">###</a></li>
-      </ul>
-    </div> -->
-    <div class="news_pl">
-      <h2>文章评论</h2>
-      <ul>
-        <div class="gbko"> </div>
-      </ul>
-    </div>
-  </div>
-  {include file="aside"}
-</div>
-
-<script src="/static/highlight/highlight.pack.js"></script>
-<script src="/static/md/js/marked.js"></script>
-<script type="text/javascript">
-  hljs.initHighlightingOnLoad();
-
-  marked.setOptions({
-    renderer: new marked.Renderer(),
-    gfm: true,
-    tables: true,
-    breaks: false,
-    pedantic: false,
-    sanitize: false,
-    smartLists: true,
-    smartypants: false,
-    highlight: function (code) {
-      return hljs.highlightAuto(code).value;
-    }
-  });
-
-  $("#preview").html(marked($("#content_md").html()));
-  function getLike(id) {
-    var num = parseInt($('#diggnum').text());
-    $.post('/getlike', {
-      'id': id
-    }, function (data) {
-      if (data.code=2) {
-        $('#diggnum').text(num+1);
-      }
-    }, 'json');
-  }
-</script>

+ 4 - 23
view/article/index.html

@@ -1,6 +1,5 @@
 <div class="box">
   <div class="place">
-    <a href="/all.html" class="{$cid==0 ? 'current_category': ''}">All</a>
     {foreach $cate_lists as $value}
     <a href="{$value.url}" class="{$cid==$value.id ? 'current_category': ''}">{$value.name}</a>
     {/foreach}
@@ -9,7 +8,7 @@
   <div class="blogs">
     {foreach $list as $val}
     <div class="bloglist">
-      <h2><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+      <h2><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
       <div class="bloginfo">
         <ul>
           <li class="author"><a href="{$val.category_url}.html"> {$val.category_name} </a></li>
@@ -21,30 +20,12 @@
       <p>{$val.summary}</p>
     </div>
     {/foreach}
-    {lt name="list|count" value="$limit"}
+    {lt name="list->count()" value="$list->listRows()"}
     <p style="text-align: center;">全都给你了, 没有更多啦(╥╯^╰╥).</p>
     {/lt}
-    <div class="pagelist">
-      <a title="Total record">共&nbsp;<b>{$lastPage}</b>&nbsp;页</a>&nbsp;&nbsp;&nbsp;
-      {neq name="page" value="1"}
-      <a href="{$baseUrl}">首页</a>
-      <a href="{$baseUrl}-{$page - 1}">上一页</a>&nbsp;
-      {/neq}
-      <b>{$page}</b>&nbsp;
-      {if ( $lastPage != 0) && ( $lastPage != $page) }
-      <a href="{$baseUrl}-{$page + 1}">下一页</a>&nbsp;
-      <a href="{$baseUrl}-{$lastPage}">尾页</a>
-      {/if}
-      <input type="number" min="1" max="{$lastPage}" name="topage">
-      <a href="javascript:goto()">转到</a>
+    <div class="page">
+      {$list|raw}
     </div>
   </div>
   {include file="aside"}
 </div>
-
-<script>
-  function goto() {
-    var page = $("input[name='topage']").val();
-    window.location.href = "{$baseUrl}-" + page;
-  }
-</script>

+ 0 - 45
view/article/lists.bak.html

@@ -1,45 +0,0 @@
-<div class="box">
-  <!-- <div class="place" id="pageContents">
-
-      <a href="/jstt/bj/" target="_blank" id="pagecurrent">心得笔记</a>
-
-      <a href="/jstt/css3/" target="_blank">CSS3|Html5</a>
-
-      <a href="/jstt/web/" target="_blank">网站建设</a>
-
-      <a href="/news/jsex/" target="_blank">JS经典实例</a>
-
-      <a href="/jstt/t/" target="_blank">推荐工具</a>
-  </div> -->
-  <div class="blank"></div>
-  <div class="blogs">
-    {foreach $data.lists as $val}
-    <div class="bloglist">
-      <h2><a href="/read/{$val.id}"
-          title="{$val.title}">{$val.title}</a></h2>
-      <p>{$val.summary}</p>
-    </div>
-    {/foreach}
-    {lt name="data.count" value="$data.num_of_per"}
-    <p style="text-align: center;">全都给你了, 没有更多啦(╥╯^╰╥).</p>
-    {/lt}
-    <div class="pagelist">
-      <a title="Total record">共&nbsp;<b>{$data.pages}</b>页</a>&nbsp;&nbsp;&nbsp;
-      {neq name="page" value="1"}
-      <a href="{:url('/lists/'.$cid.'/1')}">首页</a>
-      <a href="{:url('/lists/'.$cid.'/'.($page - 1))}">上一页</a>&nbsp;
-      {/neq}
-      {php}$start = ceil($page/5)*5-4;{/php}
-      {for start="$start" end="$start+5" comparison="lt" step="1" name="npage"}
-      {eq name="page" value="$npage"}
-      <b>{$npage}</b>&nbsp;
-      {else}
-      <a href="{:url('/lists/'.$cid.'/'.$npage, 'page=')}">{$npage}</a>&nbsp;
-      {/eq}
-      {/for}
-      <a href="{:url('/lists/'.$cid.'/'.($page + 1))}">下一页</a>&nbsp;
-      <a href="{:url('/lists/'.$cid.'/'.$data.pages)}">尾页</a>
-    </div>
-  </div>
-  {include file="aside"}
-</div>

+ 3 - 3
view/article/read.html

@@ -33,13 +33,13 @@
       {empty name="prev_next.prev"}
       <p>上一篇:<a >没有了</a></p>
       {else}
-      <p>上一篇:<a href="/{$prev_next['prev']['create_time']|date='Y/m-d'}/{$prev_next['prev']['id']}" title="{$prev_next.prev.title}">{$prev_next.prev.title}</a></p>
+      <p>上一篇:<a href="/{$prev_next['prev']['id']}" title="{$prev_next.prev.title}">{$prev_next.prev.title}</a></p>
       {/empty}
       {empty name="prev_next.next"}
-      <p>下一篇:<a href="{:url($data.route)}">返回列表</a></p>
+      <p>下一篇:<a href="{:url($data.category_url)}">返回列表</a></p>
       {else}
       <p>下一篇:<a
-          href="/{$prev_next['next']['create_time']|date='Y/m-d'}/{$prev_next['next']['id']}"
+          href="/{$prev_next['next']['id']}"
           title="{$prev_next.next.title}">{$prev_next.next.title}</a></p>
       {/empty}
     </div>

+ 31 - 0
view/article/search.html

@@ -0,0 +1,31 @@
+<div class="box">
+  <div class="search_place">
+    <h2>Search for</h2>
+    <form action="" method="get">
+      <input type="text" value="{$key ?? 'search'}" name="key" id="key" class="input-key">
+      <input type="submit" id="search" value="搜索" class="input-submit">
+    </form>
+  </div>
+  <div class="blank"></div>
+  {notempty name="key"}
+  <div class="blogs" style="width: 100%;">
+    {foreach $list as $val}
+    <div class="bloglist">
+      <h2><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+      <div class="bloginfo">
+        <ul>
+          <li class="author"><a href="{:url($val.category_url)}"> {$val.category_name} </a></li>
+          <li class="timer">{$val.create_time}</li>
+          <li class="view">{$val.hits} 已阅读</li>
+          <li class="like">{$val.likes}</li>
+        </ul>
+      </div>
+      <p>{$val.summary}</p>
+    </div>
+    {/foreach}
+    <div class="page">
+      {$list|raw}
+    </div>
+  </div>
+  {/notempty}
+</div>

+ 4 - 1
view/article/tag.html

@@ -6,7 +6,7 @@
   <div class="blogs">
     {foreach $list as $val}
     <div class="bloglist">
-      <h2><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+      <h2><a href="/{$val.aid}.html" title="{$val.title}">{$val.title}</a></h2>
       <div class="bloginfo">
         <ul>
           <li class="author"><a href="/{$val.route}"> {$val.category_name} </a></li>
@@ -18,6 +18,9 @@
       <p>{$val.summary}</p>
     </div>
     {/foreach}
+    <div class="page">
+      {$list|raw}
+    </div>
   </div>
   {include file="aside"}
 </div>

+ 3 - 7
view/article/time.html

@@ -2,16 +2,12 @@
   <div class="timebox">
     <ul>
       {foreach $list as $val}
-      <li><span>{$val.create_time|date="Y-m-d"}</span><i><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}"
+      <li><span>{$val.create_time|date="Y-m-d"}</span><i><a href="/{$val.id}"
             title="{$val.title}">{$val.title}</a></i></li>
       {/foreach}
     </ul>
   </div>
-  <div class="pagelist">
-    {if $page > 1} <a href="/time-{$page-1}.html">«</a> {/if}
-    {for start="1" end="$lastPage+1"}
-    {if $page == $i} <b>{$i}</b>&nbsp; {else /} <a href="/time-{$i}.html">{$i}</a>&nbsp; {/if}
-    {/for}
-    {if $page < $lastPage} <a href="/time-{$page+1}.html">»</a> {/if}
+  <div class="page">
+    {$list|raw}
   </div>
 </article>

+ 10 - 5
view/aside.html

@@ -1,9 +1,14 @@
 <aside>
+  <div class="paihang">
+    <a href="/search" title="search">
+      <input type="text" value="搜索: 标题、关键词" name="key" id="key" class="aside-search-input" style="width: 95%;height: 20px;padding: 10px;">
+    </a>
+  </div>
   <div class="paihang">
     <h2>最近更新</h2>
     <ul>
       {tp:listbycid cid="0" name="value" limit="7" order="id DESC"}
-      <li><a href="/index/{$value.create_time|date='Y/m-d'}/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
+      <li><a href="/{$value.id}" title="{$value.title}">{$value.title}</a></li>
       {/tp:listbycid}
     </ul>
   </div>
@@ -11,7 +16,7 @@
     <h2>点击排行</h2>
     <ul>
       {tp:listbycid cid="0" name="value" limit="7" order="hits DESC"}
-      <li><a href="/index/{$value.create_time|date='Y/m-d'}/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
+      <li><a href="/{$value.id}" title="{$value.title}">{$value.title}</a></li>
       {/tp:listbycid}
     </ul>
   </div>
@@ -19,15 +24,15 @@
     <h2>博文推荐</h2>
     <ul>
       {tp:listbycid cid="0" name="value" limit="7"}
-      <li><a href="/{$value.create_time|date='Y/m-d'}/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
+      <li><a href="/{$value.id}" title="{$value.title}">{$value.title}</a></li>
       {/tp:listbycid}
     </ul>
   </div>
   <div class="paihang">
     <h2>归档</h2>
     <ul>
-      {tp:listtime name="value" limit="5"}
-      <li><a href="/{:str_replace('-','/',$value->pubmonth)}" title="{$value->pubmonth}">{:str_replace('-','年',$value->pubmonth)}月</a></li>
+      {tp:listtime name="value" limit="0"}
+      <li><a href="/{$value->pubmonth}" title="{$value->pubmonth}">{:str_replace('-','年',$value->pubmonth)}月</a></li>
       {/tp:listtime}
     </ul>
   </div>

+ 192 - 0
view/index/about.html

@@ -22,4 +22,196 @@
       </p>
     </div>
   </div>
+  <style>
+    .comment-respond {
+      background: white;
+      box-shadow: 0 0 2px 0 rgba(58, 58, 58, 0.2);
+      padding: 1.5em 4.6875375%;
+    }
+
+    .guestbook {
+      width: 100%;
+      float: left;
+      padding-bottom: 3em;
+    }
+
+    .guestbook h2 span {
+      font-size: 12px;
+    }
+
+    @media only screen and (max-width: 767px) {
+      .comment-respond {
+        background: white;
+        box-shadow: 0 0 2px 0 rgba(58, 58, 58, 0.2);
+        padding: 1.5em 7.50006%;
+      }
+    }
+
+    h3 {
+      font-size: 1.125em;
+      /* 18px / 16px */
+      line-height: 1.333;
+      /* 24px */
+    }
+
+    .comment-respond p {
+      margin: 1.125em 0;
+    }
+
+    .comment-respond p.comment-notes {
+      margin: 1.5em 0;
+    }
+
+    .comment-respond label {
+      display: block;
+      margin-bottom: 6px;
+      font-weight: 700;
+      font-size: 0.875em;
+      line-height: 1.715;
+    }
+
+    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]):not([type="image"]),
+    textarea {
+      width: 100%;
+      font-family: "Roboto", "Open Sans", sans-serif;
+      font-weight: 400;
+      padding: 10px 12px;
+      max-width: 27.75em;
+      min-height: 26px;
+      background: #F7F7F7;
+      color: #333333;
+      border: solid 1px #D4D4D4;
+      border-radius: 0;
+      -webkit-appearance: none;
+      -webkit-transition: background 0.2s;
+      transition: background 0.2s;
+    }
+
+    textarea {
+      max-width: 41.625em;
+      overflow: auto;
+    }
+
+    .comment-respond p.form-submit {
+      margin-top: 2.25em;
+    }
+
+    input[type="submit"] {
+      font-size: 0.75em;
+      line-height: 1.5;
+    }
+
+    input[type="submit"] {
+      font-family: "Roboto", "Open Sans", sans-serif;
+      font-weight: 400;
+      padding: 10px 12px;
+      color: #333333;
+      border: solid 1px #333333;
+      background: none;
+      border-radius: 0;
+      -webkit-appearance: none;
+      -webkit-transition: all 0.2s;
+      transition: all 0.2s;
+    }
+
+    .pager {
+      margin-left: 10%;
+      width: 60%;
+      background: red;
+    }
+
+    ul.pager li:first-child {
+      float: left;
+    }
+
+    ul.pager li:last-child {
+      float: left;
+      margin-left: 30%;
+    }
+  </style>
+
+
+  <div class="newsview">
+    <h2>留言</h2>
+    <div class="news_infos">
+      <p>有什么想告诉我说的, 就在这吧ヾ(✿゚▽゚)ノ</p>
+    </div>
+  </div>
+  <!-- #respond -->
+  <div id="respond" class="comment-respond">
+    <h3 id="reply-title" class="comment-reply-title">Leave a Reply</h3>
+    <form action="{:url('/index/save_guest_book')}" method="post" id="comment-form" class="comment-form" novalidate="">
+      <p class="comment-notes"><span id="email-notes">我会妥善保存你的邮箱哒(`・ω・´).</span> 必填项已标记<span class="required">*</span>
+      </p>
+      <p class="comment-form-comment">
+        <label for="comment">Comment*</label>
+        <textarea required="" id="content" name="content" cols="45" rows="8" aria-required="true"></textarea>
+      </p>
+      <p class="comment-form-author">
+        <label for="author">Name*</label>
+        <input id="name" name="name" type="text" placeholder="Jane Doe" value="" size="26">
+      </p>
+      <p class="comment-form-email">
+        <label for="contact">contact*</label>
+        <input id="contact" name="contact" type="text" placeholder="name@email.com or 13355556666" value="" size="26">
+      </p>
+      <p class="comment-form-url">
+        <label for="url">url</label>
+        <input id="url" name="url" type="text" placeholder="https://www.google.com" value="" size="26">
+      </p>
+      <p class="form-submit">
+        <button type="button" id="submit" class="submit">Post Comment</button>
+        <!-- <input type="hidden" name="comment_post_ID" value="23" id="comment_post_ID">
+          <input type="hidden" name="comment_parent" id="comment_parent" value="0"> -->
+      </p>
+    </form>
+    <div>
+      <p class="msg" style="display: none;color: orangered;">提交成功</p>
+    </div>
+  </div><!-- #respond end-->
+  <div class="blank"></div>
+  <div class="guestbook">
+    {php}
+    $list = \app\model\GuestBook::order('id desc')->paginate();
+    {/php}
+    {foreach $list as $val}
+    <div class="bloglist">
+      <div>
+        <h2>{$val.name} <span>{$val.time|date="Y/m/d"}</span></h2>
+      </div>
+      <p>{$val.content}</p>
+    </div>
+    {/foreach}
+    {$list->render()}
+  </div>
+
+  <script>
+    $("#submit").click(function () {
+      $.post('/save_guest_book', {
+        'name': $("#name").val(),
+        'content': $("#content").val(),
+        'contact': $("#contact").val(),
+        'url': $("#url").val(),
+      }, function (res) {
+        console.log(res);
+        if (res.code == 0) {
+          $(".msg").show();
+          var html = '<div class="bloglist"><div><h2>' + res.data.name + ' <span>' + res.data.datetime + '</span></h2>';
+          html += '</div><p>' + res.data.content + '</p></div>';
+          $(".guestbook").prepend(html);
+          setTimeout(() => {
+            $(".msg").hide();
+          }, 1000);
+          $("#comment-form")[0].reset();
+        } else {
+          $(".msg").html(res.msg);
+          $(".msg").show();
+          setTimeout(() => {
+            $(".msg").hide();
+          }, 1000);
+          $(".msg").html('提交成功');
+        }
+      }, 'json');
+    })
+  </script>
 </div>

+ 0 - 138
view/index/error.html

@@ -1,138 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
-
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <meta name="viewport" content="width=device-width">
-  <meta name='robots' content='noindex,follow' />
-  <title>Comment Submission Failure</title>
-  <style type="text/css">
-    html {
-      background: #f1f1f1;
-    }
-
-    body {
-      background: #fff;
-      color: #444;
-      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
-      margin: 2em auto;
-      padding: 1em 2em;
-      max-width: 700px;
-      -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
-      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
-    }
-
-    h1 {
-      border-bottom: 1px solid #dadada;
-      clear: both;
-      color: #666;
-      font-size: 24px;
-      margin: 30px 0 0 0;
-      padding: 0;
-      padding-bottom: 7px;
-    }
-
-    #error-page {
-      margin-top: 50px;
-    }
-
-    #error-page p {
-      font-size: 14px;
-      line-height: 1.5;
-      margin: 25px 0 20px;
-    }
-
-    #error-page code {
-      font-family: Consolas, Monaco, monospace;
-    }
-
-    ul li {
-      margin-bottom: 10px;
-      font-size: 14px;
-    }
-
-    a {
-      color: #0073aa;
-    }
-
-    a:hover,
-    a:active {
-      color: #00a0d2;
-    }
-
-    a:focus {
-      color: #124964;
-      -webkit-box-shadow:
-        0 0 0 1px #5b9dd9,
-        0 0 2px 1px rgba(30, 140, 190, .8);
-      box-shadow:
-        0 0 0 1px #5b9dd9,
-        0 0 2px 1px rgba(30, 140, 190, .8);
-      outline: none;
-    }
-
-    .button {
-      background: #f7f7f7;
-      border: 1px solid #ccc;
-      color: #555;
-      display: inline-block;
-      text-decoration: none;
-      font-size: 13px;
-      line-height: 26px;
-      height: 28px;
-      margin: 0;
-      padding: 0 10px 1px;
-      cursor: pointer;
-      -webkit-border-radius: 3px;
-      -webkit-appearance: none;
-      border-radius: 3px;
-      white-space: nowrap;
-      -webkit-box-sizing: border-box;
-      -moz-box-sizing: border-box;
-      box-sizing: border-box;
-
-      -webkit-box-shadow: 0 1px 0 #ccc;
-      box-shadow: 0 1px 0 #ccc;
-      vertical-align: top;
-    }
-
-    .button.button-large {
-      height: 30px;
-      line-height: 28px;
-      padding: 0 12px 2px;
-    }
-
-    .button:hover,
-    .button:focus {
-      background: #fafafa;
-      border-color: #999;
-      color: #23282d;
-    }
-
-    .button:focus {
-      border-color: #5b9dd9;
-      -webkit-box-shadow: 0 0 3px rgba(0, 115, 170, .8);
-      box-shadow: 0 0 3px rgba(0, 115, 170, .8);
-      outline: none;
-    }
-
-    .button:active {
-      background: #eee;
-      border-color: #999;
-      -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
-      box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
-      -webkit-transform: translateY(1px);
-      -ms-transform: translateY(1px);
-      transform: translateY(1px);
-    }
-  </style>
-</head>
-
-<body id="error-page">
-  <p>
-    <p><strong>ERROR</strong>: {$data.msg}.</p>
-  </p>
-  <p><a href='javascript:history.back()'>&laquo; Back</a></p>
-</body>
-
-</html>

+ 0 - 189
view/index/guest_book.html

@@ -1,189 +0,0 @@
-<style>
-  .comment-respond {
-    background: white;
-    box-shadow: 0 0 2px 0 rgba(58, 58, 58, 0.2);
-    padding: 1.5em 4.6875375%;
-  }
-
-  .guestbook {
-    width: 100%;
-    float: left;
-    padding-bottom: 3em;
-  }
-
-  .guestbook h2 span {
-    font-size: 12px;
-  }
-
-  @media only screen and (max-width: 767px) {
-    .comment-respond {
-      background: white;
-      box-shadow: 0 0 2px 0 rgba(58, 58, 58, 0.2);
-      padding: 1.5em 7.50006%;
-    }
-  }
-
-  h3 {
-    font-size: 1.125em;
-    /* 18px / 16px */
-    line-height: 1.333;
-    /* 24px */
-  }
-
-  .comment-respond p {
-    margin: 1.125em 0;
-  }
-
-  .comment-respond p.comment-notes {
-    margin: 1.5em 0;
-  }
-
-  .comment-respond label {
-    display: block;
-    margin-bottom: 6px;
-    font-weight: 700;
-    font-size: 0.875em;
-    line-height: 1.715;
-  }
-
-  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]):not([type="image"]),
-  textarea {
-    width: 100%;
-    font-family: "Roboto", "Open Sans", sans-serif;
-    font-weight: 400;
-    padding: 10px 12px;
-    max-width: 27.75em;
-    min-height: 26px;
-    background: #F7F7F7;
-    color: #333333;
-    border: solid 1px #D4D4D4;
-    border-radius: 0;
-    -webkit-appearance: none;
-    -webkit-transition: background 0.2s;
-    transition: background 0.2s;
-  }
-
-  textarea {
-    max-width: 41.625em;
-    overflow: auto;
-  }
-
-  .comment-respond p.form-submit {
-    margin-top: 2.25em;
-  }
-
-  input[type="submit"] {
-    font-size: 0.75em;
-    line-height: 1.5;
-  }
-
-  input[type="submit"] {
-    font-family: "Roboto", "Open Sans", sans-serif;
-    font-weight: 400;
-    padding: 10px 12px;
-    color: #333333;
-    border: solid 1px #333333;
-    background: none;
-    border-radius: 0;
-    -webkit-appearance: none;
-    -webkit-transition: all 0.2s;
-    transition: all 0.2s;
-  }
-
-  .pager {
-    margin-left: 10%;
-    width: 60%;
-    background: red;
-  }
-
-  ul.pager li:first-child {
-    float: left;
-  }
-
-  ul.pager li:last-child {
-    float: left;
-    margin-left: 30%;
-  }
-</style>
-
-<div class="box">
-  <div class="newsview">
-    <h2>留言</h2>
-    <div class="news_infos">
-      <p>有什么想告诉我说的, 就在这吧ヾ(✿゚▽゚)ノ</p>
-    </div>
-  </div>
-  <!-- #respond -->
-  <div id="respond" class="comment-respond">
-    <h3 id="reply-title" class="comment-reply-title">Leave a Reply</h3>
-    <form action="{:url('/index/save_guest_book')}" method="post" id="commentform" class="comment-form" novalidate="">
-      <p class="comment-notes"><span id="email-notes">我会妥善保存你的邮箱哒(`・ω・´).</span> 必填项已标记<span class="required">*</span>
-      </p>
-      <p class="comment-form-comment">
-        <label for="comment">Comment*</label>
-        <textarea required="" id="content" name="content" cols="45" rows="8" aria-required="true"></textarea>
-      </p>
-      <p class="comment-form-author">
-        <label for="author">Name*</label>
-        <input id="name" name="name" type="text" placeholder="Jane Doe" value="" size="26">
-      </p>
-      <p class="comment-form-email">
-        <label for="contact">contact*</label>
-        <input id="contact" name="contact" type="text" placeholder="name@email.com or 13355556666" value="" size="26">
-      </p>
-      <p class="comment-form-url">
-        <label for="url">url</label>
-        <input id="url" name="url" type="text" placeholder="https://www.google.com" value="" size="26">
-      </p>
-      <p class="form-submit">
-        <button type="button" id="submit" class="submit">Post Comment</button>
-        <!-- <input type="hidden" name="comment_post_ID" value="23" id="comment_post_ID">
-        <input type="hidden" name="comment_parent" id="comment_parent" value="0"> -->
-      </p>
-    </form>
-    <div>
-      <p class="msg" style="display: none;color: orangered;">提交成功</p>
-    </div>
-  </div><!-- #respond end-->
-  <div class="blank"></div>
-  <div class="guestbook">
-    {foreach $list as $val}
-    <div class="bloglist">
-      <div>
-        <h2>{$val.name} <span>{$val.time|date="Y/m/d"}</span></h2>
-      </div>
-      <p>{$val.content}</p>
-    </div>
-    {/foreach}
-    {$list->render()}
-  </div>
-</div>
-
-<script>
-  $("#submit").click(function () {
-    $.post('/index/save_guest_book',  {
-      'name': $("#name").val(),
-      'content': $("#content").val(),
-      'contact': $("#contact").val(),
-      'url': $("#url").val(),
-    }, function (res) {
-      console.log(res);
-      if (res.code == 0) {
-        $(".msg").show();
-        var html = '<div class="bloglist"><div><h2>'+res.data.name+'<span>'+res.data.datetime+'</span></h2>';
-          html += '</div><p>'+res.data.content+'</p></div>';
-        $(".guestbook").prepend(html);
-        setTimeout(()=>{
-          $(".msg").hide();
-        }, 1000);
-      } else {
-        $(".msg").html(res.msg);
-        $(".msg").show();
-        setTimeout(()=>{
-          $(".msg").hide();
-        }, 1000);
-        $(".msg").html('提交成功');
-      }
-    }, 'json');
-  })
-</script>

+ 8 - 8
view/index/index.html

@@ -4,7 +4,7 @@
     <div class="newstitle"><span><a href="/back.html">+</a></span><b>WEB后端</b></div>
     <ul class="newsli">
       {tp:listbycid cid="2" name="val" limit="7"}
-      <li><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></li>
+      <li><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></li>
       {/tp:listbycid}
     </ul>
   </div>
@@ -13,7 +13,7 @@
     <div class="newstitle"><span><a href="/all.html">+</a></span><b>其他</b></div>
     <ul class="newsli">
       {tp:listbycid cid="-1" name="val" limit="7"}
-      <li><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></li>
+      <li><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></li>
       {/tp:listbycid}
     </ul>
   </div>
@@ -22,7 +22,7 @@
   {tp:listbycid cid="0" name="val" limit="3"}
   <div class="sbox f_l {if $key!=0}ml{/if}">
     <span>{$val.category_name}</span>
-    <h2><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+    <h2><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
     <p>{$val.summary}</p>
   </div>
   {/tp:listbycid}
@@ -31,7 +31,7 @@
   <div class="blogs">
     {tp:listbycid cid="0" name="val" limit="15" order="id DESC"}
     <div class="bloglist">
-      <h2><a href="/{$val.create_time|date='Y/m-d'}/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
+      <h2><a href="/{$val.id}.html" title="{$val.title}">{$val.title}</a></h2>
       <div class="bloginfo">
         <ul>
           <li class="author"><a href="/{$val.category_url}.html"> {$val.category_name} </a></li>
@@ -59,7 +59,7 @@
       <h2>点击排行</h2>
       <ul>
         {tp:listbycid cid="0" name="value" limit="7" order="hits DESC"}
-        <li><a href="/{$value.create_time|date='Y/m-d'}/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
+        <li><a href="/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
         {/tp:listbycid}
       </ul>
     </div>
@@ -67,15 +67,15 @@
       <h2>博文推荐</h2>
       <ul>
         {tp:listbycid cid="0" name="value" limit="7"}
-        <li><a href="/{$value.create_time|date='Y/m-d'}/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
+        <li><a href="/{$value.id}.html" title="{$value.title}">{$value.title}</a></li>
         {/tp:listbycid}
       </ul>
     </div>
     <div class="paihang">
       <h2>归档</h2>
       <ul>
-        {tp:listtime name="value" limit="5"}
-        <li><a href="/{:str_replace('-','/',$value->pubmonth)}" title="{$value->pubmonth}">{:str_replace('-','年',$value->pubmonth)}月</a></li>
+        {tp:listtime name="value" limit="0"}
+        <li><a href="/{$value->pubmonth}" title="{$value->pubmonth}">{:str_replace('-','年',$value->pubmonth)}月</a></li>
         {/tp:listtime}
       </ul>
     </div>

+ 2 - 2
view/layout.html

@@ -16,7 +16,7 @@
     <div class="logo"><a href="{:url('/index')}">huwhois的自留地</a></div>
     <nav>
       <ul id="starlist">
-        <li><a href="{:url('/index')}">网站首页</a></li>
+        <li><a href="{:url('/index')}">首页</a></li>
         {foreach $categories as $val}
         <li><a href="{:url($val.url)}">{$val.name}</a></li>
         {/foreach}
@@ -29,7 +29,7 @@
   <div class="blank"></div>
 
   <footer>
-    <p>Power by <a href="{:env('domain.email')}" target="_blank">{:env('domain.email')}</a> </p>
+    <p>Power by <a href="mailto:{:env('domain.email')}" target="_blank">{:env('domain.email')}</a> </p>
     <p>备案号:<a href="https://beian.miit.gov.cn/" style="color:blue">{:env('domain.icp')} </a></p>
   </footer>
   {$bdtongji|raw}

+ 9 - 1
view/sys/category/save.html

@@ -31,7 +31,15 @@
             <label class="form-label col-xs-4 col-sm-2">
                 url:</label>
             <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.url}" placeholder="绑定路由地址" id="url" name="url">
+                <input type="text" class="input-text" value="{$data.url}" placeholder="绑定url" id="url" name="url">
+            </div>
+            <div class="col-3"> </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-2">
+                url:</label>
+            <div class="formControls col-xs-4 col-sm-6">
+                <input type="text" class="input-text" value="{$data.route}" placeholder="绑定路由" id="route" name="route">
             </div>
             <div class="col-3"> </div>
         </div>

+ 1 - 1
view/sys/layout.html

@@ -32,7 +32,7 @@
             <i class="Hui-iconfont">&#xe67f;</i><a href="/sys/index/index" class="maincolor">首页</a>
             {foreach $breadCrumb as $bread}
             <span class="c-999 en">&gt;</span>
-            <span class="c-666"><a href="{$bread.url ? url($bread.url) : 'javascript:void(0);'}" title="{$bread.title}">{$bread.title}</a></span>
+            <span class="c-666"><a href="{$bread.url ? '/sys/'.$bread.url : 'javascript:void(0);'}" title="{$bread.title}">{$bread.title}</a></span>
             {/foreach}
             <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                 href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>

+ 2 - 2
view/sys/public/header.html

@@ -70,7 +70,7 @@
         <dl id="menu-article">
             {eq name="value.type" value="1"}
             <dt {eq name="value.id" value="$active_pid"} class="selected"{/eq}>
-                <a href="/sys{:url($value.url)}"><i class="Hui-iconfont">{$value.icon|raw}</i> {$value.name}</a>
+                <a href="/sys/{$value.url}"><i class="Hui-iconfont">{$value.icon|raw}</i> {$value.name}</a>
             </dt>
             {else/}
             <dt {eq name="value.id" value="$active_pid"} class="selected"{/eq}>
@@ -81,7 +81,7 @@
                 {notempty name='value.child'} {foreach $value.child as $val}
                 <ul>
                     <li>
-                        <a {notempty name='val.url'} href="/sys{:url($val.url)}">{/notempty} <i class="Hui-iconfont">{$val.icon|raw}</i> {$val.name}</a>
+                        <a {notempty name='val.url'} href="/sys/{$val.url}">{/notempty} <i class="Hui-iconfont">{$val.icon|raw}</i>{$val.name}</a>
                     </li>
                 </ul>
                 {/foreach} {/notempty}