Merge pull request #13088 from dataease/pr@dev-v2@fix_share_pwd

fix: 分享密码自定义无效
This commit is contained in:
fit2cloud-chenyw 2024-11-04 13:46:02 +08:00 committed by GitHub
commit c7752631c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 3 deletions

View File

@ -213,7 +213,6 @@ const shareTips = computed(
: t('work_branch.big_data_screen')
}`
)
const shareDisable = computed(() => shareStore.getShareDisable)
const sharePeRequire = computed(() => shareStore.getSharePeRequire)
const editUuid = () => {
linkCustom.value = true
@ -275,6 +274,16 @@ const copyInfo = async () => {
ElMessage.warning(t('work_branch.error_link_hint'))
return
}
if (passwdEnable.value && !state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) {
ElMessage.warning(t('work_branch.error_password_hint'))
return
}
if (sharePeRequire.value) {
const peRequireValid = validatePeRequire()
if (!peRequireValid) {
return
}
}
formatLinkAddr()
await toClipboard(linkAddr.value)
ElMessage.success(t('common.copy_success'))
@ -435,7 +444,8 @@ const validatePwdFormat = () => {
return false
}
const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/
if (!regex.test(val)) {
const regep = new RegExp(regex)
if (!regep.test(val)) {
showPageError(t('work_branch.password_hint'), pwdRef)
return false
}

View File

@ -260,6 +260,16 @@ const copyInfo = async () => {
ElMessage.warning(t('work_branch.error_link_hint'))
return
}
if (passwdEnable.value && !state.detailInfo.autoPwd && existErrorMsg('link-pwd-error-msg')) {
ElMessage.warning(t('work_branch.error_password_hint'))
return
}
if (sharePeRequire.value) {
const peRequireValid = validatePeRequire()
if (!peRequireValid) {
return
}
}
formatLinkAddr()
await toClipboard(linkAddr.value)
ElMessage.success(t('common.copy_success'))
@ -451,7 +461,8 @@ const validatePwdFormat = () => {
return false
}
const regex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d!@#$%^&*()_+]{4,10}$/
if (!regex.test(val)) {
const regep = new RegExp(regex)
if (!regep.test(val)) {
showPageError(t('work_branch.password_hint'), pwdRef)
return false
}