diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 207e88471..91cb651c9 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -1068,7 +1068,7 @@ export default {
notSecurity: '(not safe)',
encryptHelper:
"Let's Encrypt has a frequency limit for issuing certificates, but it is sufficient to meet normal needs. Too frequent operations will cause issuance failure. For specific restrictions, please see official document ",
- ipValue: 'IP value',
+ ipValue: 'Value',
ext: 'file extension',
wafInputHelper: 'Input data by line, one line',
data: 'data',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 879bdf059..d2f6e3c9b 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -1072,7 +1072,7 @@ export default {
notSecurity: '(不安全)',
encryptHelper:
"Let's Encrypt 签发证书有频率限制,但足以满足正常需求,过于频繁操作会导致签发失败。具体限制请看 官方文档 ",
- ipValue: 'IP值',
+ ipValue: '值',
ext: '文件扩展名',
wafInputHelper: '按行输入数据,一行一个',
data: '数据',
diff --git a/frontend/src/views/website/website/config/safety/simple-list/index.vue b/frontend/src/views/website/website/config/safety/simple-list/index.vue
index 0442699a7..b11fc721a 100644
--- a/frontend/src/views/website/website/config/safety/simple-list/index.vue
+++ b/frontend/src/views/website/website/config/safety/simple-list/index.vue
@@ -18,7 +18,7 @@
{{ $t('commons.button.add') }}
-
+
@@ -116,18 +116,30 @@ const openCreate = () => {
if (ipArray.length == 0) {
return;
}
+ let newIpArray = [];
+ ipArray.forEach((ip: string) => {
+ const newIp = ip.replace(/(^\s*)|(\s*$)/g, '');
+ if (newIp != '') {
+ newIpArray.push(newIp);
+ }
+ });
+ if (newIpArray.length == 0) {
+ return;
+ }
if (req.value.rule.indexOf('ip') > -1) {
- for (const id in ipArray) {
- if (checkIp(ipArray[id])) {
+ for (const id in newIpArray) {
+ if (checkIp(newIpArray[id])) {
MsgError(i18n.global.t('commons.rule.ipErr', [ipArray[id]]));
return;
}
}
}
data.value.forEach((d) => {
- ipArray.push(d.ip);
+ newIpArray.push(d.ip);
});
- submit(ipArray);
+ if (newIpArray.length > 0) {
+ submit(newIpArray);
+ }
};
const submit = async (ipList: string[]) => {