Skip to content

Commit 7e6c6e0

Browse files
lilien1010juzhiyuan
authored andcommitted
fix configuration not show when route uri and host from old format (#77)
1 parent aeedaa4 commit 7e6c6e0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/views/schema/routes/edit.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,13 @@ export default class extends Vue {
326326
327327
private async getData() {
328328
const { id } = this.$route.params
329-
const {
329+
let {
330330
node: {
331331
value: {
332+
uri = '',
332333
uris = [],
333334
hosts = [],
335+
host = '',
334336
remote_addr = '',
335337
upstream_id = '',
336338
service_id = '',
@@ -341,6 +343,14 @@ export default class extends Vue {
341343
}
342344
} = await getRouter(id) as any
343345
346+
if (hosts.length === 0 && host.length > 0) {
347+
hosts.push(host)
348+
}
349+
350+
if (uris.length === 0 && uri.length > 0) {
351+
uris.push(uri)
352+
}
353+
344354
this.form = {
345355
uris,
346356
hosts,

0 commit comments

Comments
 (0)