Sfoglia il codice sorgente

fix: Auto correcting code is broken in advance mode #50

0xJacky 2 anni fa
parent
commit
e9f0835aea

+ 1 - 1
frontend/src/views/domain/DomainEdit.vue

@@ -18,7 +18,7 @@ const router = useRouter()
 
 const name = ref(route.params.name.toString())
 watch(route, () => {
-    name.value = route.params.name.toString()
+    name.value = route.params?.name?.toString() ?? ''
 })
 
 const update = ref(0)

+ 1 - 1
server/pkg/nginx/tokenize.go

@@ -76,7 +76,7 @@ func (s *NgxServer) parseDirective(d NgxDirective) {
 		return
 	}
 
-	regExp := regexp.MustCompile("(\\S+?)\\s+?{?(.+?)[;|}]")
+	regExp := regexp.MustCompile("(\\S+?)\\s+?{?(.+)[;|}]")
 	matchSlice := regExp.FindAllStringSubmatch(str, -1)
 
 	for k, v := range matchSlice {