Skip to content

Commit 5b7e154

Browse files
author
juzhiyuan
committed
fix: update regexp
1 parent 329b092 commit 5b7e154

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/views/schema/routes/list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export default class extends Vue {
152152
153153
let { node: { nodes = [] } } = await getList() as any
154154
nodes = [...nodes].map((item: any) => {
155-
const id = item.key.match(/\/([0-9]+)/)[1]
156-
const fakeId = parseInt(id.replace(/^(0+)/, ''))
155+
const id = item.key.match(/\/([a-zA-Z0-9-_]+)$/)[1]
156+
const fakeId = id
157157
158158
let {
159159
uri = '',

src/views/schema/service/list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ export default class extends Vue {
133133
]
134134
let { node: { nodes = [] } } = await getServiceList() as any
135135
nodes = [...nodes].map((item: any) => {
136-
const id = item.key.match(/\/([0-9]+)/)[1]
137-
const fakeId = parseInt(id.replace(/^(0+)/, ''))
136+
const id = item.key.match(/\/([a-zA-Z0-9-_]+)$/)[1]
137+
const fakeId = id
138138
const desc = item.value.desc
139139
140140
const pluginArr: any[] = []

src/views/schema/ssl/list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ export default class extends Vue {
128128
]
129129
let { node: { nodes = [] } } = await getSSLList() as any
130130
nodes = [...nodes].map((item: any) => {
131-
const id = item.key.match(/\/([0-9]+)/)[1]
132-
const fakeId = parseInt(id.replace(/^(0+)/, ''))
131+
const id = item.key.match(/\/([a-zA-Z0-9-_]+)$/)[1]
132+
const fakeId = id
133133
134134
return {
135135
id: fakeId,

src/views/schema/upstream/list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ export default class extends Vue {
160160
161161
let { node: { nodes = [] } } = await getUpstreamList() as any
162162
nodes = [...nodes].map((item: any) => {
163-
const id = item.key.match(/\/([0-9]+)/)[1]
164-
const fakeId = parseInt(id.replace(/^(0+)/, ''))
163+
const id = item.key.match(/\/([a-zA-Z0-9-_]+)$/)[1]
164+
const fakeId = id
165165
const type = item.value.type
166166
const desc = item.value.desc
167167

0 commit comments

Comments
 (0)