From c4aa30221e7e4f077fced6f0f7564240ad805640 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 1 Jun 2019 11:27:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=B9=E5=8A=A8build=E5=90=8Eindex?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/scripts/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/scripts/build.js b/public/react/scripts/build.js index 6dd9d3e5..9267272e 100644 --- a/public/react/scripts/build.js +++ b/public/react/scripts/build.js @@ -184,7 +184,9 @@ function generateNewIndexJsp() { // combinedStream.append(htmlContent); // combinedStream.pipe(fs2.createWriteStream( filePath )); - var outputPath = paths.appBuild + '/../../../app/views/common/index.html.erb' + // var outputPath = paths.appBuild + '/../../../app/views/common/index.html.erb' + var outputPath = paths.appBuild + '/../../../public/react/build/index.html' + fs2.readFile(filePath, 'utf8', function (err,data) { if (err) { return console.log(err); From 3eef8d7fd6e0c7c7dfb607ddb997e5014c8be46f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 1 Jun 2019 11:31:20 +0800 Subject: [PATCH 2/2] pull --- app/controllers/careers_controller.rb | 2 +- app/controllers/categories_controller.rb | 2 +- app/controllers/ec_courses_controller.rb | 10 +++++----- app/controllers/ec_years_controller.rb | 6 +++--- app/controllers/forums_controller.rb | 4 ++-- app/controllers/memos_controller.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- app/controllers/statistics_controller.rb | 4 ++-- app/controllers/tasks_controller.rb | 3 +-- .../awesome_nested_set/spec/fixtures/categories.yml | 2 +- 10 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/controllers/careers_controller.rb b/app/controllers/careers_controller.rb index 081bce0f..9c10a3fd 100644 --- a/app/controllers/careers_controller.rb +++ b/app/controllers/careers_controller.rb @@ -27,6 +27,6 @@ class CareersController < ApplicationController private def render_react - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end end diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index 05b36ba3..cc290d8c 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -32,6 +32,6 @@ class CategoriesController < ApplicationController private def render_react - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end end diff --git a/app/controllers/ec_courses_controller.rb b/app/controllers/ec_courses_controller.rb index a81d6796..e7e000bb 100644 --- a/app/controllers/ec_courses_controller.rb +++ b/app/controllers/ec_courses_controller.rb @@ -88,7 +88,7 @@ class EcCoursesController < ApplicationController def ec_course_support_setting respond_to do |format| format.html { - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false } format.json { course_targets = @ec_course.ec_course_targets.includes(:ec_graduation_subitems) @@ -152,19 +152,19 @@ class EcCoursesController < ApplicationController # 课程体系(课程考核与数据来源) # /ec_courses/1/ec_course_reach_setting def ec_course_reach_setting - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 课程体系(课程目标评价方法) # /ec_courses/1/evaluation_methods def evaluation_methods - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 课程达成详情(蓝胡12) # GET /ec_courses/1/competition_calculation_info def competition_calculation_info - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 评价详情的导出 @@ -425,7 +425,7 @@ class EcCoursesController < ApplicationController format.html{ Rails.logger.info("1111111111111111111template_major: #{@template_major}") Rails.logger.info("1111111111111111111is_manager: #{@is_manager}") - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false } format.json{ levels = @ec_course.ec_score_levels diff --git a/app/controllers/ec_years_controller.rb b/app/controllers/ec_years_controller.rb index c0c9483c..548e3b6e 100644 --- a/app/controllers/ec_years_controller.rb +++ b/app/controllers/ec_years_controller.rb @@ -46,7 +46,7 @@ class EcYearsController < ApplicationController def student_lists respond_to do |format| format.html { - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false } end end @@ -217,7 +217,7 @@ class EcYearsController < ApplicationController # 本专业必要要求VS课程支撑体系 def requirement_vs_courses - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 导出课程支撑体系 @@ -251,7 +251,7 @@ class EcYearsController < ApplicationController # 课程达成点计算(蓝胡13) # GET /ec_courses/1/competition_calculation_info def reach_calculation_info - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 蓝胡13数据获取 diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index afb5b7dd..f5beed7b 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -28,7 +28,7 @@ class ForumsController < ApplicationController private def render_react - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end end @@ -163,7 +163,7 @@ end # # id: 1 问题反馈 3 操作指南 5 技术分享 # def index # -# render "/common/index", :layout => false +# render file: 'public/react/build/index.html', :layout => false # end # # # GET /forums/1 diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index df266efa..d06adb8e 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -29,7 +29,7 @@ class MemosController < ApplicationController # 这样处理是为了 前端react显示图片所使用 def new - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end def create diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index ecc5ce46..56766264 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -1088,7 +1088,7 @@ class ShixunsController < ApplicationController def shixun_discuss if User.current.logged? - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false else redirect_to signin_path end diff --git a/app/controllers/statistics_controller.rb b/app/controllers/statistics_controller.rb index 9c5453d0..cd4bc9e1 100644 --- a/app/controllers/statistics_controller.rb +++ b/app/controllers/statistics_controller.rb @@ -6,7 +6,7 @@ class StatisticsController < ApplicationController before_filter :find_rate def index - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end # 用户活跃度(按月份的) @@ -187,7 +187,7 @@ class StatisticsController < ApplicationController unless User.curren.admin? render_403 end - render "/common/index", :layout => false + render file: 'public/react/build/index.html', :layout => false end def set_rate diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 36058172..d152ac2c 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -3,7 +3,6 @@ class TasksController < ApplicationController layout false def show - # redirect_to "/react/build/index.html" - render "/common/index" + render file: 'public/react/build/index.html', :layout => false end end diff --git a/lib/plugins/awesome_nested_set/spec/fixtures/categories.yml b/lib/plugins/awesome_nested_set/spec/fixtures/categories.yml index bc8e078e..fecf0773 100644 --- a/lib/plugins/awesome_nested_set/spec/fixtures/categories.yml +++ b/lib/plugins/awesome_nested_set/spec/fixtures/categories.yml @@ -1,4 +1,4 @@ -top_level: +_top_level: id: 1 name: Top Level lft: 1