From 0a44e845409e41638f3915e7b312835bcaf7f9c2 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 26 Dec 2022 16:09:43 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fixed=20=E6=8E=88=E6=9D=83=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=91=E5=AE=9A=E8=B4=A6=E5=8F=B7=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bind_users_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/bind_users_controller.rb b/app/controllers/bind_users_controller.rb index f58124529..f5ed33809 100644 --- a/app/controllers/bind_users_controller.rb +++ b/app/controllers/bind_users_controller.rb @@ -12,6 +12,7 @@ class BindUsersController < ApplicationController tip_exception '该账号已被绑定,请更换其他账号进行绑定' if bind_user.bind_open_user?(params[:type].to_s) "OpenUsers::#{params[:type].to_s.capitalize}".constantize.create!(user: bind_user, uid: session[:unionid]) + successful_authentication(bind_user) @user = bind_user end From 346ca9eb27df5776537abf3f9c068aed4fa80bac Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 26 Dec 2022 16:15:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fixed=20=E6=8E=88=E6=9D=83=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=91=E5=AE=9A=E8=B4=A6=E5=8F=B7=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/oauth/callbacks_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/oauth/callbacks_controller.rb b/app/controllers/oauth/callbacks_controller.rb index 8a06a6611..84fb96b08 100644 --- a/app/controllers/oauth/callbacks_controller.rb +++ b/app/controllers/oauth/callbacks_controller.rb @@ -76,6 +76,7 @@ class Oauth::CallbacksController < Oauth::BaseController "OpenUsers::#{platform.to_s.capitalize}".constantize.create!(user: current_user, uid: uid) end end + Rails.logger.info("[OAuth2] session[:unionid] -> #{session[:unionid]}") redirect_to "/bindlogin/#{platform}" end From a04cad32cf2ef66378d51775654318be33a2217e Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 26 Dec 2022 16:24:27 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fixed=20=E6=8E=88=E6=9D=83=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=91=E5=AE=9A=E8=B4=A6=E5=8F=B7=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/oauth/callbacks_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/oauth/callbacks_controller.rb b/app/controllers/oauth/callbacks_controller.rb index 84fb96b08..72885e7d9 100644 --- a/app/controllers/oauth/callbacks_controller.rb +++ b/app/controllers/oauth/callbacks_controller.rb @@ -69,6 +69,8 @@ class Oauth::CallbacksController < Oauth::BaseController open_user = "OpenUsers::#{platform.to_s.capitalize}".constantize.find_by(uid: uid) if open_user.present? && open_user.user.present? successful_authentication(open_user.user) + redirect_to root_path(new_user: false) + return else if current_user.blank? || !current_user.logged? session[:unionid] = uid From 6047d6a91b7c38bfcddd51e3d67d3d3a39566d19 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 27 Dec 2022 15:40:19 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fixed=20=E5=88=9B=E5=BB=BA=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=BC=80=E9=80=9A=E5=BB=BA=E6=9C=A8DevOps=20url?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/open_project_dev_ops_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/open_project_dev_ops_job.rb b/app/jobs/open_project_dev_ops_job.rb index 057d173c8..64115f25f 100644 --- a/app/jobs/open_project_dev_ops_job.rb +++ b/app/jobs/open_project_dev_ops_job.rb @@ -7,7 +7,7 @@ class OpenProjectDevOpsJob < ApplicationJob project = Project.find_by(id: project_id) user = User.find_by(id: user_id) code = jianmu_devops_code(project, user) - uri = URI.parse("#{jianmu_devops_url}/oauth2/authorize?code=#{URI.encode_www_form_component(code)}") + uri = URI.parse("#{jianmu_devops_url}/activate?code=#{URI.encode_www_form_component(code)}") response = Net::HTTP.get_response(uri) puts "jianmu_devops_url response.code ===== #{response.code}" SendTemplateMessageJob.perform_later('ProjectOpenDevOps', user_id, project_id) From 05933c9eff4d37b4f9ffbf3364363b6d1448adb1 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 28 Dec 2022 09:32:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fixed=20=E9=A1=B9=E7=9B=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=A7=81=E6=9C=89=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=AD=E9=A1=B9=E7=9B=AE=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/projects/list_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/projects/list_query.rb b/app/queries/projects/list_query.rb index c943f1317..447ab5070 100644 --- a/app/queries/projects/list_query.rb +++ b/app/queries/projects/list_query.rb @@ -45,7 +45,7 @@ class Projects::ListQuery < ApplicationQuery else items = items.by_name_or_identifier(params[:search]) end - items.or(Project.visible.where(user_id: Owner.like(params[:search]).pluck(:id))) + items.or(items.where(user_id: Owner.like(params[:search]).pluck(:id))) end def by_project_type(items) From 18ad80c51c7bb85f895acdf08fde1f79e3d1e11b Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 30 Dec 2022 10:26:59 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fixed=20=E6=8E=88=E6=9D=83=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=91=E5=AE=9A=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bind_users/create.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/bind_users/create.json.jbuilder b/app/views/bind_users/create.json.jbuilder index 0ac7dc823..7223be386 100644 --- a/app/views/bind_users/create.json.jbuilder +++ b/app/views/bind_users/create.json.jbuilder @@ -1,3 +1,4 @@ +json.status 0 json.username @user.full_name json.real_name @user.real_name json.login @user.login From b8af22e3bc91aee5d20b818615dc34cc8a3231c8 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 30 Dec 2022 10:33:11 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fixed=20=E6=8E=88=E6=9D=83=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=91=E5=AE=9A=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/settings_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 50b86d74c..def2e2c89 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -78,7 +78,7 @@ class SettingsController < ApplicationController } platform_url = Rails.application.config_for(:configuration)['platform_url'] config = Rails.application.config_for(:configuration) - (config.dig("oauth").keys - ["educoder"]).each do |provider| + (config.dig("oauth").keys - ["educoder", "wechat"]).each do |provider| @third_party_new << { name: provider, url: "#{platform_url}/auth/#{provider}",