Browse Source

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

pull/327/head
yystopf 3 years ago
parent
commit
4f92b29889
3 changed files with 3 additions and 0 deletions
  1. +1
    -0
      app/controllers/accounts_controller.rb
  2. +1
    -0
      app/services/api/v1/users/update_email_service.rb
  3. +1
    -0
      app/services/api/v1/users/update_phone_service.rb

+ 1
- 0
app/controllers/accounts_controller.rb 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])



+ 1
- 0
app/services/api/v1/users/update_email_service.rb 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)


+ 1
- 0
app/services/api/v1/users/update_phone_service.rb 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)


Loading…
Cancel
Save