From 72a37d74c7e7d9da30909ad574af46de2e128a6a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 9 Dec 2019 16:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=AF=86=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index b73dc48ff..388959aca 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -183,7 +183,7 @@ class User < ApplicationRecord #validates_format_of :ID_number, with: VALID_NUMBER_REGEX, multiline: true, message: "身份证号格式不对" # validates :nickname, presence: true, length: { maximum: 10 } # validates :lastname, presence: true - validates :password, with: VALID_PASSWORD_REGEX, message: "8~16位密码,支持字母数字和符号" + validates_format_of :password, with: VALID_PASSWORD_REGEX, multiline: true, message: "8~16位密码,支持字母数字和符号" # 删除自动登录的token,一旦退出下次会提示需要登录 def delete_autologin_token(value)