正在显示
3 个修改的文件
包含
31 行增加
和
4 行删除
@@ -14,7 +14,7 @@ class IndexController extends RestBaseController | @@ -14,7 +14,7 @@ class IndexController extends RestBaseController | ||
14 | * @description 默认访问接口 | 14 | * @description 默认访问接口 |
15 | * @author Soul of Cinder | 15 | * @author Soul of Cinder |
16 | * @url /home/index/index | 16 | * @url /home/index/index |
17 | - * @method POST | 17 | + * @method GET |
18 | * | 18 | * |
19 | * @return version:版本号 | 19 | * @return version:版本号 |
20 | * @return code:错误码 | 20 | * @return code:错误码 |
@@ -11,9 +11,35 @@ namespace app\portal\controller; | @@ -11,9 +11,35 @@ namespace app\portal\controller; | ||
11 | use cmf\controller\HomeBaseController; | 11 | use cmf\controller\HomeBaseController; |
12 | use EasyWeChat\Foundation\Application; | 12 | use EasyWeChat\Foundation\Application; |
13 | 13 | ||
14 | +/** | ||
15 | + * @title 欢迎页 | ||
16 | + * @description 欢迎使用在线接口文档 | ||
17 | + */ | ||
14 | class IndexController extends HomeBaseController { | 18 | class IndexController extends HomeBaseController { |
15 | - public function index() { | ||
16 | - | 19 | + /** |
20 | + * @title 首页 | ||
21 | + * @description 默认访问接口 | ||
22 | + * @author Soul of Cinder | ||
23 | + * @url /home/index/index | ||
24 | + * @method GET | ||
25 | + * | ||
26 | + * @return version:版本号 | ||
27 | + * @return code:错误码 | ||
28 | + */ | ||
29 | + public function index() | ||
30 | + { | ||
31 | + $data=[ | ||
32 | + 'version' => '1.0.0', | ||
33 | + 'code'=>[ | ||
34 | + '20000' => '默认成功返回码', | ||
35 | + '40000' => '默认错误返回码', | ||
36 | + '40001' => '未登录或登录失效', | ||
37 | + '40002' => '签名验证失败', | ||
38 | + '40003' => '缺少必要参数或参数格式错误', | ||
39 | + '40004' => '登录失败', | ||
40 | + ] | ||
41 | + ]; | ||
42 | + $this->success("恭喜您,API访问成功!", $data); | ||
17 | } | 43 | } |
18 | 44 | ||
19 | } | 45 | } |
@@ -8,7 +8,8 @@ class Doc | @@ -8,7 +8,8 @@ class Doc | ||
8 | 'version'=>'1.0.0', | 8 | 'version'=>'1.0.0', |
9 | 'copyright'=>'银河百荣科技', | 9 | 'copyright'=>'银河百荣科技', |
10 | 'controller' => [ | 10 | 'controller' => [ |
11 | - 'api\\home\\controller\\IndexController' | 11 | + 'api\\home\\controller\\IndexController', |
12 | + 'app\\portal\\controller\\IndexController' | ||
12 | ], | 13 | ], |
13 | 'password'=>'bronet', | 14 | 'password'=>'bronet', |
14 | 'static_path'=>'', | 15 | 'static_path'=>'', |
-
请 注册 或 登录 后发表评论