update check keyword response

This commit is contained in:
chenjing 2023-09-25 12:49:14 +08:00
parent 8d7c114b40
commit 6bd1eef14a
1 changed files with 7 additions and 2 deletions

View File

@ -362,8 +362,13 @@ class AccountsController < ApplicationController
def check_keywords
text = params[:text].to_s.each_char.select { |c| c.bytes.first < 240 }.join('')
tip_exception("无法使用以下关键词:#{text},请重新命名") if ReversedKeyword.check_exists?(text)
render_ok
data = ReversedKeyword.check_exists?(text)
result = {
status: 0,
data: data,
message: data ? "" : "无法使用以下关键词:#{text},请重新命名"
}
render_ok(result)
end
private