新增:建木账号禁止修改账号信息

This commit is contained in:
yystopf 2023-01-31 14:19:07 +08:00
parent b64aef9494
commit 4f92b29889
3 changed files with 3 additions and 0 deletions

View File

@ -213,6 +213,7 @@ class AccountsController < ApplicationController
def change_password
@user = User.find_by(login: params[:login])
return render_error("此用户禁止修改密码!") if @user.id.to_i === 104691
return render_error("未找到相关用户!") if @user.blank?
return render_error("旧密码不正确") unless @user.check_password?(params[:old_password])

View File

@ -18,6 +18,7 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
end
def call
raise Error, "此用户禁止修改邮箱." if @user.id.to_i === 104691
raise Error, errors.full_messages.join(",") unless valid?
raise Error, "密码不正确." unless @user.check_password?(@password)
exist_owner = Owner.find_by(mail: @mail)

View File

@ -15,6 +15,7 @@ class Api::V1::Users::UpdatePhoneService < ApplicationService
end
def call
raise Error, "此用户禁止修改手机号." if @user.id.to_i === 104691
raise Error, errors.full_messages.join(",") unless valid?
raise Error, "密码不正确." unless @user.check_password?(@password)
exist_owner = Owner.find_by(phone: @phone)