diff --git a/app/libs/hot_search_keyword.rb b/app/libs/hot_search_keyword.rb new file mode 100644 index 000000000..e222bf3a7 --- /dev/null +++ b/app/libs/hot_search_keyword.rb @@ -0,0 +1,22 @@ +class HotSearchKeyword + class << self + def add(keyword) + return if keyword.blank? + Rails.cache.data.zincrby(redis_key, 1, keyword) + end + + def hot(limit = 5) + Rails.cache.data.zrevrange(redis_key, 0, limit - 1) + end + + def available? + Rails.cache.is_a?(ActiveSupport::Cache::RedisStore) + end + + private + + def redis_key + 'educoder:es:hot_keyword' + end + end +end \ No newline at end of file diff --git a/app/services/create_bind_user_service.rb b/app/services/create_bind_user_service.rb index 93d9d87ca..f7fc5b6f6 100644 --- a/app/services/create_bind_user_service.rb +++ b/app/services/create_bind_user_service.rb @@ -17,7 +17,7 @@ class CreateBindUserService < ApplicationService bind_user = User.try_to_login(params[:username], params[:password]) raise Error, '用户名或者密码错误' if bind_user.blank? - raise Error, '该账号已被绑定' if bind_user.bind_open_user?(params[:type].to_s) + raise Error, '该账号已被其他微信号绑定,请更换其他账号进行绑定' if bind_user.bind_open_user?(params[:type].to_s) ActiveRecord::Base.transaction do open_user.user_id = bind_user.id diff --git a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js index aa7a54cce..c71ef38ea 100644 --- a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js +++ b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js @@ -61,7 +61,8 @@ class Titlesearchsection extends Component{
- {title} + {/* title={title} */} + {title}