开发者认证
This commit is contained in:
parent
7ef4efa37a
commit
04e008fcfa
@ -11,7 +11,8 @@
|
||||
|
||||
namespace catchAdmin\system\controller;
|
||||
|
||||
use catcher\base\CatchRequest as Request;
|
||||
use think\Request as Request;
|
||||
use catcher\CatchAuth;
|
||||
use catcher\CatchResponse;
|
||||
use catcher\base\CatchController;
|
||||
use catchAdmin\system\model\Developers as DevelopersModel;
|
||||
@ -37,6 +38,19 @@ class Developer extends CatchController
|
||||
return CatchResponse::paginate($this->model->getList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发者认证
|
||||
*
|
||||
* @time 2020年07月13日
|
||||
* @param Request $request
|
||||
* @param CatchAuth $auth
|
||||
* @return mixed
|
||||
*/
|
||||
public function authenticate(Request $request, CatchAuth $auth)
|
||||
{
|
||||
return CatchResponse::success($auth->guard('developer')->username('username')->attempt($request->post()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
|
@ -31,4 +31,9 @@ class Developers extends Model
|
||||
];
|
||||
|
||||
|
||||
public function setPasswordAttr($value)
|
||||
{
|
||||
return password_hash($value, PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
}
|
@ -34,3 +34,5 @@ $router->group(function () use ($router){
|
||||
|
||||
//developer路由
|
||||
$router->resource('developer', '\catchAdmin\system\controller\Developer')->middleware('auth');
|
||||
// 开发者认证
|
||||
$router->post('developer/authenticate', '\catchAdmin\system\controller\Developer@authenticate');
|
Loading…
x
Reference in New Issue
Block a user