Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
杨树林 6 years ago
commit 64aeb8acb3

@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey] if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user user = open_class_user
start_user_session(user) if user if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user User.current = user
end end
end end

@ -11,8 +11,8 @@ json.results do
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换 # 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
json.content highlights json.content highlights
end end

Loading…
Cancel
Save