diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 888e212e3..e9fe4ed94 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -51,6 +51,13 @@ class UsersController < ApplicationController :disposition => 'attachment' #inline can open in browser end + def html_show + @contents = File.read("#{params[:path]}") + respond_to do |format| + format.html {render :layout => false} + end + end + # Redo: 消息总数缓存 def get_navigation_info @old_domain = edu_setting('old_edu_host') diff --git a/app/views/users/html_show.html.erb b/app/views/users/html_show.html.erb new file mode 100644 index 000000000..0fb51d1b8 --- /dev/null +++ b/app/views/users/html_show.html.erb @@ -0,0 +1 @@ +<%= @contents.html_safe %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 90872faa8..71cfb8c55 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -58,6 +58,7 @@ Rails.application.routes.draw do post :unfollow get :get_user_info get :attachment_show + get :html_show get :get_navigation_info post :reply_message get :search_user_projects