Browse Source

check keywords

pull/338/head
chenjing 2 years ago
parent
commit
892aa31ea9
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      app/controllers/accounts_controller.rb
  2. +1
    -0
      config/routes.rb

+ 6
- 0
app/controllers/accounts_controller.rb View File

@@ -359,6 +359,12 @@ class AccountsController < ApplicationController
Register::LoginCheckColumnsForm.new(check_params.merge(user: current_user)).validate!
render_ok
end

def check_keywords
text = params[:text]&.gsub(/\s+/, "")
tip_exception("无法使用以下关键词:#{text},请重新命名") if ReversedKeyword.check_exists?(text)
render_ok
end
private



+ 1
- 0
config/routes.rb View File

@@ -261,6 +261,7 @@ Rails.application.routes.draw do
post :remote_password
post :change_password
post :check
post :check_keywords
post :login_check
post :simple_update
end


Loading…
Cancel
Save