<?php

namespace app\admin\controller\sms;

use app\admin\controller\BaseController;
use app\admin\server\sms\VerificationCodeServer;

class VerificationCode extends BaseController
{
    /**
     * Notes:获取验证码
     * User: yym
     * Date: 2022/7/23
     */
    public function getCode()
    {
        $mobile = $this->request->get('mobile');
        $this->validateCheck('sms\VerificationCodeValidate',['mobile' => $mobile]);
        $user_id = $this->request->user_id ?? 0;
        $result = VerificationCodeServer::getCode($mobile, $user_id);
        if($result)
        {
            return json_success([], '发送成功');
        }
    }
}
