<?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\validate\api\student;

use think\Validate;

class Login extends Validate{

	protected $rule = [
		'name'   => 'require|chsAlpha',
		'mobile'       => 'require|mobile|unique:student',
		'password'       => 'require',
		'repassword'=>'require|confirm:password'
	];
	protected $message = [
		'password.require' => '登录密码必须',
		'mobile.require' => '手机号码必须',
		'mobile.mobile'  => '手机号码不正确',
		'mobile.unique'  => '当前手机号码已注册',
		'name.require' => '姓名必须',
		'name.chsAlpha' => '姓名格式不正确',
		'repassword.require' => '确认密码必须',
		'repassword.confirm' => '两次密码输入不同'
	];
	protected $scene = [
		'login'  => ['name', 'mobile', 'password'],
		'register'  => ['name', 'mobile', 'password', 'repassword'],
		'resetpasswd'  => ['name', 'password']
	];
}