123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- * 应用表单校验相关配置
- * 依赖:graceChecker.js 进行校验
- *
- * 使用:引入该js到页面,let res = graceChecker.check({phoneNo:"",code:""},formRule.loginRule)
- */
- export default {
- /* 用户密码登录 */
- loginByPassRule: [{
- name: 'mobile',
- checkType: 'notnull',
- checkRule: '',
- errorMsg: '手机号不能为空'
- }, {
- name: 'mobile',
- checkType: 'phoneno',
- checkRule: '',
- errorMsg: '手机号格式不正确'
- }, {
- name: 'password',
- checkType: 'string',
- checkRule: '6,18',
- errorMsg: '请输入6-18位密码'
- }],
- /* 用户验证码登录 */
- loginByCodeRule: [{
- name: 'mobile',
- checkType: 'notnull',
- checkRule: '',
- errorMsg: '手机号不能为空'
- }, {
- name: 'mobile',
- checkType: 'phoneno',
- checkRule: '',
- errorMsg: '手机号格式不正确'
- }, {
- name: 'code',
- checkType: 'string',
- checkRule: '4',
- errorMsg: '请输入4位验证码'
- }],
- /* 发送验证码验证手机号 */
- sendCodeRule: [{
- name: 'mobile',
- checkType: 'notnull',
- checkRule: '',
- errorMsg: '手机号不能为空'
- }, {
- name: 'mobile',
- checkType: 'phoneno',
- checkRule: '',
- errorMsg: '手机号格式不正确'
- }],
- /* 用户注册 */
- registerRule: [{
- name: 'mobile',
- checkType: 'notnull',
- checkRule: '',
- errorMsg: '手机号不能为空'
- }, {
- name: 'mobile',
- checkType: 'phoneno',
- checkRule: '',
- errorMsg: '手机号格式不正确'
- }, {
- name: 'code',
- checkType: 'string',
- checkRule: '4',
- errorMsg: '请输入4位验证码'
- }, {
- name: 'password',
- checkType: 'string',
- checkRule: '6,18',
- errorMsg: '请输入6-18位密码'
- }
- ],
- /* 密码重置 */
- resetPasswordRule: [{
- name: 'mobile',
- checkType: 'notnull',
- checkRule: '',
- errorMsg: '手机号不能为空'
- }, {
- name: 'mobile',
- checkType: 'phoneno',
- checkRule: '',
- errorMsg: '手机号格式不正确'
- }, {
- name: 'code',
- checkType: 'string',
- checkRule: '4',
- errorMsg: '请输入4位验证码'
- }, {
- name: 'password',
- checkType: 'string',
- checkRule: '6,18',
- errorMsg: '请输入6-18位密码'
- }
- ]
- };
|