@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user
start_user_session(user) if user
if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user
@ -11,8 +11,8 @@ json.results do
reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '')
highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
json.content highlights