代码同步支持www优化

This commit is contained in:
谢思 2026-05-28 16:16:30 +08:00
parent a7e8bfc2ac
commit 50615e33ef
1 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ function EditStore(props){
const platformList = (synchronizedPlatformList.length && ["Github", "Gitee", "Osredm"].filter(item=>synchronizedPlatformList.indexOf(item) === -1)) || ["Github", "Gitee", "Osredm"]
// giteegithub
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)){