From 5e2725ad9f76bd6caee48c824dd224c0c5ac3749 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= <zoujingli@qq.com>
Date: Wed, 7 Apr 2021 16:00:37 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=AD=97?=
 =?UTF-8?q?=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/data/controller/api/Data.php | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/data/controller/api/Data.php b/app/data/controller/api/Data.php
index 21044a29d..415379272 100644
--- a/app/data/controller/api/Data.php
+++ b/app/data/controller/api/Data.php
@@ -11,6 +11,19 @@ use think\admin\Controller;
  */
 class Data extends Controller
 {
+
+    /**
+     * 获取指定数据对象
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function getData()
+    {
+        $data = $this->_vali(['name.require' => '数据名称不能为空!']);
+        $this->success('获取数据对象', sysdata($data['name']));
+    }
+
     /**
      * 获取轮播图片数据
      * @throws \think\db\exception\DataNotFoundException
@@ -20,7 +33,7 @@ class Data extends Controller
     public function getSlider()
     {
         $data = sysdata(input('keys', 'slider'));
-        $this->success('获取轮播图片数据', $data);
+        $this->success('获取轮播图片', $data);
     }
 
     /**
@@ -36,6 +49,6 @@ class Data extends Controller
         if (($id = input('id')) > 0) {
             $this->app->db->name('BaseUserMessage')->where(['id' => $id])->inc('num_read')->update();
         }
-        $this->success('获取系统通知数据', $result);
+        $this->success('获取系统通知', $result);
     }
 }
\ No newline at end of file