check keywords

This commit is contained in:
chenjing
2023-09-25 11:29:44 +08:00
parent 3235a60a34
commit 892aa31ea9
2 changed files with 7 additions and 0 deletions

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