diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e9fe4ed94..23f6870c8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,6 +3,12 @@ class UsersController < ApplicationController before_action :load_user, only: [:show, :homepage_info] before_action :check_user_exist, only: [:show, :homepage_info] + # 检查是否更新 + def system_update + @notice = SystemUpdateNotice.last + end + + def show;end def update diff --git a/app/views/users/system_update.json.jbuilder b/app/views/users/system_update.json.jbuilder new file mode 100644 index 000000000..c8cf5a565 --- /dev/null +++ b/app/views/users/system_update.json.jbuilder @@ -0,0 +1,6 @@ +if @notice && @notice.end.time < Time.now + json.system_update true + json.(@notice, :subject, :notes, :start_time, :end_time) +else + json.system_update false +end \ No newline at end of file