From 4199f4097cae6eb22f9c0627285a56d050c0eb59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 9 Aug 2022 10:22:55 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20reposyncer=20gitlink=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ob_repository_syncs_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/ob_repository_syncs_controller.rb b/app/controllers/ob_repository_syncs_controller.rb index 0ba17163c..ebae8e427 100644 --- a/app/controllers/ob_repository_syncs_controller.rb +++ b/app/controllers/ob_repository_syncs_controller.rb @@ -13,7 +13,8 @@ class ObRepositorySyncsController < ApplicationController tip_exception "参数错误" if params[:github_address].blank? && params[:gitee_address].blank? project_name ="#{@project.owner.name}:#{@project.identifier}" service = ObRepositorySync::ApiService.new(project_name) - project_params = params.merge({ "gitlink_address": "https://gitlink.org.cn/#{@project.owner&.login}/#{@project.identifier}.git" }) + domain = GiteaService.gitea_config[:domain] + project_params = params.merge({ "gitlink_address": "#{domain}/#{@project.owner&.login}/#{@project.identifier}.git" }) res = service.create_projects(project_params) tip_exception "保存失败: #{res["msg"]}" if res["code"].to_s != "200" sync_id = res["data"]["id"]