From a6cade88c79d1ec3d3b7f1bf091e6a73c8b5185e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 22 Jul 2019 15:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 6 ++++++ app/views/users/system_update.json.jbuilder | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 app/views/users/system_update.json.jbuilder 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