You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
44 lines
1.0 KiB
<?php
|
|
|
|
namespace App\Controller\v3;
|
|
|
|
use App\Constants\v3\ErrorCode;
|
|
use App\Controller\BaseController;
|
|
use App\Request\v3\UserBindTelRequest;
|
|
use App\Service\v3\Interfaces\UserBindTelServiceInterface;
|
|
use App\Service\v3\Interfaces\VerifyCodeServiceInterface;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
/**
|
|
* 用户相关
|
|
* Class UserController
|
|
* @package App\Controller\v3
|
|
*/
|
|
class UserController extends BaseController
|
|
{
|
|
|
|
/**
|
|
* @Inject
|
|
* @var VerifyCodeServiceInterface
|
|
*/
|
|
protected $verifyCodeService;
|
|
|
|
/**
|
|
* @Inject
|
|
* @var UserBindTelServiceInterface
|
|
*/
|
|
protected $userBindTelService;
|
|
|
|
public function bindTel(UserBindTelRequest $request)
|
|
{
|
|
|
|
// 获取参数
|
|
$params = $request->validated();
|
|
// 校验验证码
|
|
$this->verifyCodeService->check($params['user_id'], $params['tel'], $params['verify_code']);
|
|
// 绑定
|
|
$this->userBindTelService->do($params['user_id'], $params['tel']);
|
|
|
|
return $this->success([]);
|
|
}
|
|
}
|