修复安全组规则方向校验与旧工单切换错对象

This commit is contained in:
cieanyau committed 2026-11-06 01:38:19 +08:00
1 parent bcb47f102c
commit 4bc84717ff
3 files changed
+323 -4

No files matched your search

+9 -3
View File
@@ -579,7 +579,7 @@ var Te = {
let Q = ref(!1),
$ = ref(``),
Lt = ref(!1);
// 每行按方向、协议、端口、IP 和可选描述解析;空行忽略,不足四列明确报格式错误。
// 先把自由文本收敛为方向、协议的封闭枚举;任一行无效就拒绝整批,不能猜成入站规则。
function Rt(e) {
let t = [];
for (let n of e.split(`
@@ -589,9 +589,15 @@ var Te = {
let r = e.split(/\s+/);
if (r.length < 4) throw Error(`格式不正确:${e}`);
let [ee, i, te = ``, a = ``, ...o] = r;
let direction = ee.toLowerCase(),
protocol = i.toLowerCase();
if (!["in", "out"].includes(direction))
throw Error(`规则方向必须为 in 或 out:${ee}`);
if (!["tcp", "udp", "icmp", "all"].includes(protocol))
throw Error(`规则协议必须为 tcp、udp、icmp 或 all:${i}`);
t.push({
direction: ee === `out` ? `out` : `in`,
protocol: (i || `tcp`).toLowerCase(),
direction,
protocol,
port: te,
ip: a,
description: o.join(` `) || void 0,
+4 -1
View File
@@ -1,10 +1,13 @@
<script>
/**
* 旧工单详情路由适配层:复用动态工单详情页,详情 ID 由被复用页从路由参数/查询中读取。
* 旧工单详情路由适配层:复用动态详情页;完整地址变化时重建详情,避免沿用上一工单的 ID 与草稿。
*/
import "~/assets/styles/TicketAttachments.DtbJGLkE.css";
import "~/assets/styles/RichTextEditor.NkmgPT5m.css";
import "~/assets/styles/_id_.C-0--Lx-.css";
definePageMeta({
key: (route) => route.fullPath,
});
import { createBlock } from "vue";
import { defineComponent } from "vue";
import { openBlock } from "vue";