Kaynağa Gözat

fix: 修复负载均衡界面异常的问题

tuon 1 yıl önce
ebeveyn
işleme
a90e955e28
2 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 4 3
      src/pages/nginx/upstream/tab.tsx
  2. 1 1
      vite.config.ts

+ 4 - 3
src/pages/nginx/upstream/tab.tsx

@@ -44,10 +44,11 @@ export const UpstreamTab = forwardRef<ITabInstance, IProps>(({server, isStream},
         const upstreams = server?.upstreams;
         if (Array.isArray(upstreams) && upstreams.length){
           const items =upstreams.map((item: any)=>{
-            if (!item.key){
-              item.key = uniqueKey(20)
+              const copy = {...item};
+            if (!copy.key){
+                copy.key = uniqueKey(20)
             }
-            return item
+            return copy
           })
             setData(items)
         }else {

+ 1 - 1
vite.config.ts

@@ -43,7 +43,7 @@ export default defineConfig({
   server:{
     proxy: {
       "/api":{
-        target: 'http://10.10.0.1:8081',
+        target: 'http://10.10.0.1:8080',
         // target: 'http://127.0.0.1:8080',
         rewrite: path => path.replace(/^\/api/,"")
       }