diff --git a/core/core-frontend/src/views/share/share/ShareHandler.vue b/core/core-frontend/src/views/share/share/ShareHandler.vue index 1830b0cb42..3597734db8 100644 --- a/core/core-frontend/src/views/share/share/ShareHandler.vue +++ b/core/core-frontend/src/views/share/share/ShareHandler.vue @@ -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 } diff --git a/core/core-frontend/src/views/share/share/ShareVisualHead.vue b/core/core-frontend/src/views/share/share/ShareVisualHead.vue index 0efaf72ac6..34e7d9fe00 100644 --- a/core/core-frontend/src/views/share/share/ShareVisualHead.vue +++ b/core/core-frontend/src/views/share/share/ShareVisualHead.vue @@ -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 }