From e07dddde98b573ec9c89ad9d3c08d862f9b89f09 Mon Sep 17 00:00:00 2001 From: qyzh Date: Wed, 15 Jul 2020 10:55:13 +0800 Subject: [PATCH] before merge --- app/controllers/application_controller.rb | 7 ++++--- app/controllers/settings_controller.rb | 2 +- public/options/readme/readme | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 public/options/readme/readme diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 994c6357..baece64c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -342,7 +342,9 @@ class ApplicationController < ActionController::Base elsif params[:debug] == 'student' User.current = User.find 8686 elsif params[:debug] == 'admin' - User.current = User.find 1 + user = User.find 1 + User.current = user + cookies.signed[:user_id] = user.id end end # User.current = User.find 81403 @@ -386,7 +388,6 @@ class ApplicationController < ActionController::Base else User.current end - # User.current end ## 默认输出json @@ -794,4 +795,4 @@ class ApplicationController < ActionController::Base HotSearchKeyword.add(keyword) end -end +end \ No newline at end of file diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index bb031c7b..72b5360e 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -1,6 +1,6 @@ class SettingsController < ApplicationController def show - @old_projects_url = nil + @old_projects_url = nil @old_projects_url = "https://www.trustie.net/users/#{current_user.try(:login)}/projects" if User.current.logged? end end diff --git a/public/options/readme/readme b/public/options/readme/readme new file mode 100644 index 00000000..cc620a13 --- /dev/null +++ b/public/options/readme/readme @@ -0,0 +1,20 @@ +## 从命令行创建一个新的仓库 + +```bash +touch README.md +git init +git add README.md +git commit -m "first commit" +git remote add origin http://gitea.trustie.net/qiubing/gitea_binary_package.git +git push -u origin master + +``` + +## 从命令行推送已经创建的仓库 + +```bash +git remote add origin http://gitea.trustie.net/qiubing/gitea_binary_package.git +git push -u origin master + +``` +