LoginValidate.php 502 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\admin\validate\index;
  3. use think\Validate;
  4. class LoginValidate extends Validate
  5. {
  6. //定义规则
  7. protected $rule = [
  8. 'user_name' => 'require',
  9. 'password' => 'require',
  10. ];
  11. //定义描述
  12. protected $message = [
  13. 'user_name.require' => '登录账号不能为空',
  14. 'password.require' => '登录密码不能为空'
  15. ];
  16. //定义场景
  17. protected $scene = [
  18. 'login_admin' => ['user_name','password'],
  19. ];
  20. }