Browse Source

update html

chao 20 hours ago
parent
commit
6d51346dfa
1 changed files with 3 additions and 5 deletions
  1. 3 5
      public/index.html

+ 3 - 5
public/index.html

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