1、修复bug
2、创建模型字段问题
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller;
|
||||
use api\BaseAuth;
|
||||
|
||||
class AccessToken extends BaseAuth {
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller;
|
||||
use api\BaseRest;
|
||||
|
||||
class Base extends BaseRest {
|
||||
|
||||
// 允许访问的请求类型
|
||||
protected $restMethodList = 'get|post|put|delete|patch|head|options';
|
||||
//业务错误码的映射表
|
||||
public $errMap = [
|
||||
0 => 'success', //没有错误
|
||||
1001 => '参数错误',
|
||||
9999 => '自定义错误', //让程序给出的自定义错误
|
||||
];
|
||||
|
||||
//是否开启权限认证
|
||||
public $apiAuth = true;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Request;
|
||||
|
||||
class Index extends Base {
|
||||
|
||||
public $apiAuth = true;
|
||||
// 允许访问的请求类型
|
||||
protected $restMethodList = 'get|post|';
|
||||
|
||||
/**
|
||||
* get的响应
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResponse(Request $request) {
|
||||
return $this->sendError(1001, 'THIS IS GET', 400);
|
||||
}
|
||||
|
||||
/**
|
||||
* post的响应
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function postResponse(Request $request) {
|
||||
return $this->sendSuccess('THIS IS POST');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user