huwhois 5 місяців тому
батько
коміт
c87c43874c

+ 0 - 2
app/api/common.php

@@ -1,2 +0,0 @@
-<?php
-// 这是系统自动生成的公共文件

+ 0 - 100
app/api/controller/Index.php

@@ -1,100 +0,0 @@
-<?php
-declare (strict_types = 1);
-
-namespace app\api\controller;
-
-use think\App;
-use think\exception\HttpException;
-
-use app\model\Category;
-use app\model\Article;
-use app\model\ArticleTags;
-use app\model\ArticleDolikeLog;
-
-class Index
-{
-    /**
-     * 构造方法
-     * @access public
-     * @param App $app 应用对象
-     */
-    public function __construct(App $app)
-    {
-        $this->app     = $app;
-        $this->request = $this->app->request;
-    }
-
-    public function index()
-    {
-        return '您好!这是一个[api]示例应用';
-    }
-
-    public function menu()
-    {
-        return json(Category::where('is_nav', 1)->order(['sort desc'])->select());
-    }
-
-    public function list()
-    {
-        $params = $this->app->request->param();
-
-        $cid = isset($params['cid']) ? (int)$params['cid'] : 0;
-
-        $list = Article::queryPage($params);
-
-        $category = Category::find($cid);
-
-        if ($category) {
-            $baseUrl = $category->url;
-        } else {
-            $baseUrl = '/index/all';
-        }
-
-        return json([
-            'baseUrl'  => $baseUrl,
-            'list' => $list->all(),
-            'total' => $list->total(),
-            'limit' => $list->listRows(),
-            'page' => $list->currentPage(),
-            'lastPage' => $list->lastPage(),
-            'cid' => $cid,
-        ]);
-    }
-
-    /**
-     * 文章详情
-     */
-    public function read($id = null)
-    {
-        $data = Article::getOne($id);
-
-        if (!$data) {
-            return json(['msg'=>'页面不存在'], 404);
-        }
-
-        $data->hits += 1;
-
-        $data->save();
-
-        $prev_next = Article::getNextPrev($id, $data->cid);
-
-        if ($data->content_type == 1) {
-            $parsedownExtension = new \ParsedownExtension();
-            $parsedownExtension->setTocEnabled(true);
-            $res = $parsedownExtension->text($data->content);
-            $data->toc = $res['toc'];
-            $data->content = $res['content'];
-        }
-
-        return json([
-            'cid' => $data->cid,
-            'data' => $data,
-            'prev_next' => $prev_next,
-            'seo' => [
-                'title' => $data->title,
-                'key' => $data->keywords,
-                'des' => $data->summary,
-            ]
-        ]);
-    }
-}

+ 0 - 25
app/api/route/app.php

@@ -1,25 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkPHP [ WE CAN DO IT JUST THINK ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
-// +----------------------------------------------------------------------
-// | Author: liu21st <liu21st@gmail.com>
-// +----------------------------------------------------------------------
-use think\facade\Route;
-
-Route::pattern([
-    'name' => '\w+',
-    'id' => '\d+',
-    'cid' => '\d+',
-    'page' => '\d+',
-    'year' => '\d+',
-    'month' => '\d+',
-    'day' => '\d+',
-]); 
-
-Route::get('menu', 'index/menu');
-Route::get('list', 'index/list');
-Route::get('/read/:id', 'index/read');

+ 0 - 17
app/controller/sys/config/app.php

@@ -1,17 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | 应用设置
-// +----------------------------------------------------------------------
-
-return [
-    // 应用Trace
-    'app_trace'              => true,
-    // 是否开启权限认证
-    'auth_on'               => true,
-    // 默认分页显示数量
-    'page_size'             => 20,
-    // 版本信息
-    'sys_version'          => '0.1',
-    // 默认密码
-    'default_password' => 'qwe123',
-];

+ 0 - 9
app/controller/sys/config/view.php

@@ -1,9 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | 模板设置
-// +----------------------------------------------------------------------
-
-return [
-    // 开启模板布局
-    'layout_on'    => true,
-];

+ 1 - 1
app/controller/sys/listener/SysUserLog.php → app/listener/SysUserLog.php

@@ -1,7 +1,7 @@
 <?php
 declare (strict_types = 1);
 
-namespace app\sys\listener;
+namespace app\listener;
 
 use app\model\SysLog;