<?php  namespace  App\Http\Requests\Api;

use App\Http\Requests\BaseRequest;

/**
 * 管理后台登录验证
 * @author  liuxaingxin
 *
 * */
class Login extends BaseRequest{

    /**
     *
     * @return  array
     */
    public  function  rules(){
        return [
            'phone'     =>  'required|phone',
            'code'      =>  'required',
            'sms_code'  =>  'required|check_code',
            'email_code'  =>  'required|check_code',
        ];
    }

    // 场景列表
    protected   $scenes         = [
		'login'  		        => ['phone','code'],
        'phone'  		        => ['phone','sms_code'],
        'email'  		        => ['email','email_code'],
	];

    /**
     *
     * @return  array
     */
    public  function  messages(){
        return [
            'phone.required'  =>  '请输入登录账号',
            'email.required'  =>  '请输入登录邮箱账号',
            'code.required'   =>  '请输入登录验证码',
            'sms_code.required'   =>  '请输入登录验证码',
            'email_code.required'   =>  '请输入登录验证码',
        ];
    }

}
