Skip to content

Commit

Permalink
feature: 文件上传本地文件上传后缀调整 TencentBlueKing#1375
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Sep 26, 2022
1 parent d302f8c commit 8ab23ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
}
const realRule = rule.toLowerCase();
// . 开头,中间不允许出现空格
if (!/^\.[a-z]+(.[a-z]+)*$/.test(realRule)) {
if (!/^\.[a-zA-Z]+(.[a-zA-Z_-]+)*$/.test(realRule)) {
errorStack.push(realRule);
return;
}
Expand All @@ -135,7 +135,7 @@
}, []).join(';');
suffixError += renameError;
}
return suffixError ? `${I18n.t('setting..开头,后面跟上不超过24个英文字符,中间不允许出现空格:')}${suffixError}` : '';
return suffixError ? `${I18n.t('setting..开头,后面跟上数字、字母、横杠(-)、下划线(_):')}${suffixError}` : '';
};

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/views/global-setting/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* IN THE SOFTWARE.
*/

/* eslint-disable max-len */
export default {
namespace: 'setting',
message: {
Expand Down Expand Up @@ -129,6 +130,6 @@ export default {
设置允许范围: 'Allowed From',
设置禁止范围: 'Limited From',
不允许为空: 'is required',
'.开头,后面跟上不超过24个英文字符,中间不允许出现空格:': 'Start with dot(.), followed by lowercase up to 24 characters: ',
'.开头,后面跟上数字、字母、横杠(-)、下划线(_):': 'Start with dot(.), followed by lowercase / numbers / _ or -, up to 24 characters ',
},
};

0 comments on commit 8ab23ee

Please sign in to comment.