diff --git a/app/controllers/ob_repository_syncs_controller.rb b/app/controllers/ob_repository_syncs_controller.rb index 013e6fe55..0f1c64b1b 100644 --- a/app/controllers/ob_repository_syncs_controller.rb +++ b/app/controllers/ob_repository_syncs_controller.rb @@ -13,7 +13,7 @@ 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) - params.merge({ "gitlink_address": @project.repository.url }) + params = params.merge({ "gitlink_address": @project.repository.url }) res = service.create_projects(params) tip_exception "保存失败: #{res["msg"]}" if res["code"].to_s != "200" sync_id = res["data"]["id"] @@ -23,6 +23,7 @@ class ObRepositorySyncsController < ApplicationController ob_repository_sync.name = project_name ob_repository_sync.github_address = "#{params[:github_address]}" ob_repository_sync.gitee_address = "#{params[:gitee_address]}" + ob_repository_sync.gitlink_address = @project.repository.url ob_repository_sync.github_token = "#{params[:github_token]}" ob_repository_sync.gitee_token = "#{params[:gitee_token]}" ob_repository_sync.sync_id = sync_id diff --git a/app/libs/custom_regexp.rb b/app/libs/custom_regexp.rb index e778c5499..889da4df8 100644 --- a/app/libs/custom_regexp.rb +++ b/app/libs/custom_regexp.rb @@ -1,6 +1,6 @@ module CustomRegexp PHONE = /1\d{10}/ - EMAIL = /\A[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/ + EMAIL = /\A[a-zA-Z0-9]+([._\-\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/ LOGIN = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]{4,15}\z/ #只含有数字、字母、下划线不能以下划线开头和结尾 LASTNAME = /\A[a-zA-Z0-9\u4e00-\u9fa5]+\z/ NICKNAME = /\A[\u4e00-\u9fa5_a-zA-Z0-9]+\z/