chao 22 ore fa
parent
commit
6d51346dfa
1 ha cambiato i file con 3 aggiunte e 5 eliminazioni
  1. 3 5
      public/index.html

+ 3 - 5
public/index.html

@@ -658,7 +658,7 @@
     </div>
     </div>
 
 
     <script>
     <script>
-        const requesturl = window.location.href.indexOf("localhost") > -1 ? "http://localhost:11111" : window.location.origin+":11111";
+        const requesturl = window.location.href;
         console.log("requesturl:",requesturl);        
         console.log("requesturl:",requesturl);        
 
 
         // 切换下载和报名区域
         // 切换下载和报名区域
@@ -964,7 +964,7 @@
                     return;
                     return;
                 }
                 }
                 // 发送报名信息请求
                 // 发送报名信息请求
-                const registerResponse = await fetch('https://prep.cocorobo.cn/api/user', {
+                const registerResponse = await fetch(requesturl+'api/user', {
                     method: 'POST',
                     method: 'POST',
                     headers: {
                     headers: {
                         'Content-Type': 'application/json'
                         'Content-Type': 'application/json'
@@ -1042,7 +1042,7 @@
             }
             }
 
 
             try{
             try{
-                const response = fetch("https://prep.cocorobo.cn/api/update", {
+                const response = fetch(requesturl+"api/update", {
                     method: "POST",
                     method: "POST",
                     headers: {
                     headers: {
                         "Content-Type": "application/json"
                         "Content-Type": "application/json"
@@ -1064,8 +1064,6 @@
                 console.error('信息更新失败:', error);
                 console.error('信息更新失败:', error);
                 alert(error.message);
                 alert(error.message);
             }
             }
-            
-            
         }
         }
 
 
     </script>
     </script>