fixed reposyncer gitlink地址配置文件取

This commit is contained in:
“xxq250” 2022-08-09 10:22:55 +08:00
parent e7aa05b535
commit 4199f4097c
1 changed files with 2 additions and 1 deletions

View File

@ -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"]