代码同步支持www优化
This commit is contained in:
parent
a7e8bfc2ac
commit
50615e33ef
|
|
@ -149,7 +149,7 @@ function EditStore(props){
|
|||
const platformList = (synchronizedPlatformList.length && ["Github", "Gitee", "Osredm"].filter(item=>synchronizedPlatformList.indexOf(item) === -1)) || ["Github", "Gitee", "Osredm"]
|
||||
|
||||
// 正则:校验是否是gitee或者github的仓库地址
|
||||
const pattern = platform && (platform === "Github" ? /^https:\/\/(www\.)?github\.com\/.+\/.+$/ : platform === "Gitee" ? /^https:\/\/(www\.)?gitee\.com\/.+\/.+$/ : /^https:\/\/(www\.)?osredm\.com\/.+\/.+$/)
|
||||
const pattern = platform && (platform === "Github" ? /^https:\/\/github\.com\/.+\/.+$/ : platform === "Gitee" ? /^https:\/\/gitee\.com\/.+\/.+$/ : /^https:\/\/(www\.)?osredm\.com\/.+\/.+$/)
|
||||
|
||||
useEffect(()=>{
|
||||
// 获取分支列表
|
||||
|
|
@ -264,7 +264,7 @@ function EditStore(props){
|
|||
// 保存用户已经输入的值
|
||||
validateFields(['type', 'external_repo_address', 'external_token'], (error, formValues )=>{
|
||||
if(!error){
|
||||
const address = formValues.external_repo_address.replace(".git", "").replace(`https://${platform.toLowerCase()}.com/`, "")
|
||||
const address = formValues.external_repo_address.replace(".git", "").replace(new RegExp(`https://(www\\.)?${platform.toLowerCase()}\\.com/`, "i"), "")
|
||||
// 获取github/gitee仓库的分支列表
|
||||
platform && axios.get(`/v1/${address}/branches/${platform.toLowerCase()}`, {params: {page: 1, limit: 100, token: formValues.external_token}}).then(res=>{
|
||||
if(res && res.data && Array.isArray(res.data)){
|
||||
|
|
|
|||
Loading…
Reference in New Issue