From b7a0d1c867572d3512ad673c9ebd4d5540f55c7f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 3 Jan 2020 10:23:54 +0800 Subject: [PATCH] 1 --- app/controllers/shixuns_controller.rb | 8 ++++---- config/routes.rb | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index b76704c07..e84e83c71 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -18,9 +18,9 @@ class ShixunsController < ApplicationController before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file, :jupyter_exec] - before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, :apply_public, + before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, :apply_public, :upload_git_folder, :shixun_members_added, :change_manager, :collaborators_delete, :upload_git_file, - :cancel_apply_public, :cancel_publish, :add_collaborators, :add_file] + :cancel_apply_public, :cancel_publish, :add_collaborators, :add_file, :delete_git_file] before_action :portion_allowed, only: [:copy] before_action :special_allowed, only: [:send_to_course, :search_user_courses] @@ -897,12 +897,12 @@ class ShixunsController < ApplicationController end def upload_git_folder - raise("文件夹名不合法") if params[:folder_name] =~ /^[^\\\/\?\*\"\>\<\:\|]*$/ - + render_ok end def delete_git_file + render_ok end def add_collaborators diff --git a/config/routes.rb b/config/routes.rb index 69d6d9377..2e860b0b0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -280,6 +280,8 @@ Rails.application.routes.draw do post :commits post :file_content post :upload_git_file + post :upload_git_folder + delete :delete_git_file post :update_file post :close post :add_file