dev_jupyter
daiao 5 years ago
parent 65e0485519
commit db82ed009b

@ -46,6 +46,12 @@ module GitHelper
content: content, author_name: username, author_email: mail) content: content, author_name: username, author_email: mail)
end end
def update_file_base64_content(content, repo_path, path, mail, username, message)
content = Base64.encode64(content)
GitService.update_file_base64(repo_path: repo_path, file_path: path, message: message,
content: content, author_name: username, author_email: mail)
end
# 添加目录 # 添加目录
def git_add_folder(folder_path, author_name, author_email, message) def git_add_folder(folder_path, author_name, author_email, message)
GitService.add_tree(file_path: folder_path, message: message, author_name: author_name, author_email: author_email) GitService.add_tree(file_path: folder_path, message: message, author_name: author_name, author_email: author_email)

@ -896,7 +896,7 @@ class ShixunsController < ApplicationController
author_email = current_user.git_mail author_email = current_user.git_mail
message = params[:message] || "upload file by browser" message = params[:message] || "upload file by browser"
uid_logger("-----author_email: #{author_email}") uid_logger("-----author_email: #{author_email}")
update_file_content(content, @repo_path, @path, author_email, author_name, message) update_file_base64_content(content, @repo_path, @path, author_email, author_name, message)
render_ok render_ok
end end

Loading…
Cancel
Save