Browse Source

1、feat: nginx return内容

tuon 1 year ago
parent
commit
31b39dfcf4
1 changed files with 1 additions and 6 deletions
  1. 1 6
      frontend/src/pages/nginx/components/location/utils.ts

+ 1 - 6
frontend/src/pages/nginx/components/location/utils.ts

@@ -102,12 +102,7 @@ export const renderLocation = (origin: INginxLocation) => {
 
   if (loc.return?.code){
     let content = loc.return.content
-    if (!content.startsWith('\'')){
-      content = `'${content}`
-    }
-    if (!content.endsWith('\'')){
-      content = `${content}'`
-    }
+    content = JSON.stringify(content)
     lines.push(`    return  ${loc.return.code || 200}   ${content};`)
   }