|
@@ -0,0 +1,59 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace support;
|
|
|
+
|
|
|
+class Validate extends \think\Validate
|
|
|
+{
|
|
|
+ protected $typeMsg = [
|
|
|
+ 'require' => ':attribute 必填',
|
|
|
+ 'must' => ':attribute 必须',
|
|
|
+ 'number' => ':attribute 必须是数字',
|
|
|
+ 'integer' => ':attribute 必须是整数',
|
|
|
+ 'float' => ':attribute 必须是小数',
|
|
|
+ 'boolean' => ':attribute 必须是布尔型',
|
|
|
+ 'email' => ':attribute 必须是邮箱格式',
|
|
|
+ 'mobile' => ':attribute 必须是手机号码格式',
|
|
|
+ 'array' => ':attribute 必须是数组',
|
|
|
+ 'accepted' => ':attribute 必须同意',
|
|
|
+ 'date' => ':attribute 必须是时间格式',
|
|
|
+ 'file' => ':attribute 必须是文件',
|
|
|
+ 'image' => ':attribute 必须是图片',
|
|
|
+ 'alpha' => ':attribute 必须是字母',
|
|
|
+ 'alphaNum' => ':attribute 必须是字母和数字组合',
|
|
|
+ 'alphaDash' => ':attribute 必须是字母和下划线组合',
|
|
|
+ 'activeUrl' => ':attribute 必须是域或IP地址',
|
|
|
+ 'chs' => ':attribute 必须是汉字',
|
|
|
+ 'chsAlpha' => ':attribute 格式错误',
|
|
|
+ 'chsAlphaNum' => ':attribute 必须是汉字,字母,下划线',
|
|
|
+ 'chsDash' => ':attribute 必须是汉字,数字,字母,下划线',
|
|
|
+ 'url' => ':attribute 必须是链接格式',
|
|
|
+ 'ip' => ':attribute 必须是IP格式',
|
|
|
+ 'dateFormat' => ':attribute 必须是时间格式 :rule',
|
|
|
+ 'in' => ':attribute 必须在 :rule 之中',
|
|
|
+ 'notIn' => ':attribute 不在 :rule 之中',
|
|
|
+ 'between' => ':attribute 必须在 :1 - :2 之间',
|
|
|
+ 'notBetween' => ':attribute 不在 :1 - :2 之间',
|
|
|
+ 'length' => ':attribute 长度必须小于 :rule',
|
|
|
+ 'max' => ':attribute 长度必须小于 :rule ',
|
|
|
+ 'min' => ':attribute 必须大于 :rule',
|
|
|
+ 'after' => ':attribute 不能小于 :rule',
|
|
|
+ 'before' => ':attribute 不能超过 :rule',
|
|
|
+ 'expire' => ':attribute 不在有效期内 :rule',
|
|
|
+ 'allowIp' => '当前IP不允许访问',
|
|
|
+ 'denyIp' => '访问IP被拒绝',
|
|
|
+ 'confirm' => ':attribute out of accord with :2',
|
|
|
+ 'different' => ':attribute cannot be same with :2',
|
|
|
+ 'egt' => ':attribute 必须大于或等于:rule',
|
|
|
+ 'gt' => ':attribute 必须大于 :rule',
|
|
|
+ 'elt' => ':attribute 必须小于或等于 :rule',
|
|
|
+ 'lt' => ':attribute 必须小于 :rule',
|
|
|
+ 'eq' => ':attribute 必须等于 :rule',
|
|
|
+ 'unique' => ':attribute 已存在',
|
|
|
+ 'regex' => ':attribute 不符合规则',
|
|
|
+ 'method' => '无效的请求方法',
|
|
|
+ 'token' => '无效的令牌',
|
|
|
+ 'fileSize' => '文件大小不匹配',
|
|
|
+ 'fileExt' => '文件类型不允许上传',
|
|
|
+ 'fileMime' => '文件类型不允许上传',
|
|
|
+ ];
|
|
|
+}
|