瀏覽代碼

1、feat: nginx return内容

tuon 1 年之前
父節點
當前提交
31b39dfcf4
共有 1 個文件被更改,包括 1 次插入6 次删除
  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};`)
   }