Files
electron-egg/app/utils/validataRules.js
gaoshuaixing be06d62916 1
2020-12-30 11:39:20 +08:00

43 lines
863 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict';
// 正则校验规则集合
const regRule = require('./regRule');
// 校验规则
const validateRules = {
// 账号校验1手机号&&密码
accountType1: () => {
return {
email: {
type: 'string',
required: true,
allowEmpty: false,
format: regRule.emailReg,
},
password: {
type: 'string',
require: true,
allowEmpty: false,
format: regRule.passwordReg1,
},
};
},
// 账号校验2手机号&&验证码登录
accountType2: () => {
return {
// phone: {
// type: 'string',
// required: true,
// allowEmpty: false,
// format: regRule.phoneReg,
// },
code: {
type: 'string',
required: true,
allowEmpty: false,
},
};
},
};
module.exports = validateRules;