From 7ac84a612912c366a13a7435a16e5bcdc564f4fb Mon Sep 17 00:00:00 2001 From: kron Date: Sat, 14 Jun 2025 22:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis.js | 9 ++------- src/websocket.js | 5 +++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/apis.js b/src/apis.js index 0dacfa3..1e70183 100644 --- a/src/apis.js +++ b/src/apis.js @@ -1,4 +1,4 @@ -const BASE_URL = "http://120.79.241.5:8000/api/shoot"; +const BASE_URL = "https://api.shelingxingqiu.com/api/shoot"; function request(method, url, data = {}) { const token = uni.getStorageSync("token"); @@ -207,11 +207,6 @@ export const getBattleListAPI = async (page, battleType) => { .sort((a, b) => b.totalScore - a.totalScore), }); }); + console.log(1111, result); return data; }; - -export const getBattleDetailAPI = (id) => { - return request("POST", "/user/battle/detail", { - id, - }); -}; diff --git a/src/websocket.js b/src/websocket.js index 5e18132..17899ea 100644 --- a/src/websocket.js +++ b/src/websocket.js @@ -5,8 +5,9 @@ let heartbeatInterval = null; * 建立 WebSocket 连接 */ function createWebSocket(token, onMessage) { + const url = `wss://api.shelingxingqiu.com/socket?authorization=${token}`; socket = uni.connectSocket({ - url: `ws://120.79.241.5:8000/socket?authorization=${token}`, + url, success: () => console.log("websocket 连接成功"), }); @@ -23,7 +24,7 @@ function createWebSocket(token, onMessage) { uni.onSocketClose((result) => { console.log("WebSocket 已关闭", result); socket = uni.connectSocket({ - url: `ws://120.79.241.5:8000/socket?authorization=${token}`, + url, success: () => console.log("websocket 连接成功"), }); });