fix(项目设置): 自定义代码片段,标签过长导致sql异常

--bug=1027547 --user=王旭 【项目设置】github#25349-更多选项-自定义代码片段:标签字段输入字符数过长时点击确定提示提示sql error https://www.tapd.cn/55049933/s/1390363
This commit is contained in:
WangXu10 2023-07-07 14:20:22 +08:00 committed by 刘瑞斌
parent 0839ccb99e
commit 627b884d8c
4 changed files with 8 additions and 1 deletions

View File

@ -124,7 +124,11 @@ export default {
addTag(tag) { addTag(tag) {
tag = tag.trim() tag = tag.trim()
if (tag && !this.innerTags.includes(tag)) { if (tag && !this.innerTags.includes(tag)) {
this.innerTags.push(tag) if (tag.length > 15) {
this.$error(this.$t('commons.tag_length_tip'));
return false
}
this.innerTags.push(tag);
return true return true
} else { } else {
if (tag !== "" && this.errorInfo) { if (tag !== "" && this.errorInfo) {

View File

@ -389,6 +389,7 @@ const message = {
}, },
image: "Image", image: "Image",
tag: "Tag", tag: "Tag",
tag_length_tip: "The length of the tag cannot exceed 15 characters",
append_tag: "Append Tag", append_tag: "Append Tag",
append_tag_tip: append_tag_tip:
"Checked: add a new label; unchecked: overwrite the original label;", "Checked: add a new label; unchecked: overwrite the original label;",

View File

@ -382,6 +382,7 @@ const message = {
}, },
image: "镜像", image: "镜像",
tag: "标签", tag: "标签",
tag_length_tip: "标签长度不能超过15个字符",
append_tag: "追加标签", append_tag: "追加标签",
append_tag_tip: "勾选:新增标签;不勾选:覆盖原有标签;", append_tag_tip: "勾选:新增标签;不勾选:覆盖原有标签;",
module: { module: {

View File

@ -383,6 +383,7 @@ const message = {
image: "鏡像", image: "鏡像",
tag: "標簽", tag: "標簽",
append_tag: "追加標籤", append_tag: "追加標籤",
tag_length_tip: "標籤長度不能超過15個字符",
append_tag_tip: "勾選:新增標籤;不勾選:覆蓋原有標籤;", append_tag_tip: "勾選:新增標籤;不勾選:覆蓋原有標籤;",
module: { module: {
select_module: "選擇模塊", select_module: "選擇模塊",