import type { Rule } from 'ant-design-vue/es/form'

export const phonePattern = /^1[3|4|5|7|8][0-9]\d{8}$/
export const passwordPattern = /^[^\u4e00-\u9fa5]{1,16}$/

export const phoneRule: Rule = {
  required: true,
  pattern: phonePattern,
  message: '请输入正确手机号码'
}

export const passwordRule: Rule = {
  required: true,
  pattern: passwordPattern,
  message: '手机号或密码有误'
}

export const rules = {
  phone: passwordRule,
  password: passwordRule
}
