From e02237a9e0cd520703dae3127439ef5ade93af18 Mon Sep 17 00:00:00 2001 From: jasder Date: Wed, 3 Nov 2021 18:25:57 +0800 Subject: [PATCH] FIX code review --- app/controllers/accounts_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 4008791b..c2d7c99c 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -157,7 +157,7 @@ class AccountsController < ApplicationController # 用户登录 def login - Users::LoginForm.new(account_params).validate! + Users::LoginForm.new(login_params).validate! @user = User.try_to_login(params[:login], params[:password]) return normal_status(-2, "错误的账号或密码") if @user.blank? @@ -353,7 +353,7 @@ class AccountsController < ApplicationController params.require(:user).permit(:login, :email, :phone) end - def account_params + def login_params params.require(:account).permit(:login, :password) end