From 213988d9056c57d9baa7a340db636f508c783866 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 1 Jul 2024 16:07:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=A4=BA=E4=BE=8B=E9=A1=B5=E9=9D=A2=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 +++--- .../{websocket-socketTask.test.js => socketTask.test.js} | 2 +- .../{websocket-socketTask.uvue => socketTask.uvue} | 0 pages/API/websocket/websocket.uvue | 8 ++++++++ pages/pages.test.js | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) rename pages/API/websocket/{websocket-socketTask.test.js => socketTask.test.js} (85%) rename pages/API/websocket/{websocket-socketTask.uvue => socketTask.uvue} (100%) diff --git a/pages.json b/pages.json index a5a46293..c1027346 100644 --- a/pages.json +++ b/pages.json @@ -659,15 +659,15 @@ } }, { - "path": "pages/API/websocket/websocket-socketTask", + "path": "pages/API/websocket/socketTask", "style": { - "navigationBarTitleText": "websocket-socketTask" + "navigationBarTitleText": "socketTask" } }, { "path": "pages/API/websocket/websocket", "style": { - "navigationBarTitleText": "websocket-global" + "navigationBarTitleText": "websocket" } }, { diff --git a/pages/API/websocket/websocket-socketTask.test.js b/pages/API/websocket/socketTask.test.js similarity index 85% rename from pages/API/websocket/websocket-socketTask.test.js rename to pages/API/websocket/socketTask.test.js index 0b53e85d..563dbeeb 100644 --- a/pages/API/websocket/websocket-socketTask.test.js +++ b/pages/API/websocket/socketTask.test.js @@ -1,4 +1,4 @@ -const PAGE_PATH = '/pages/API/websocket/websocket-socketTask' +const PAGE_PATH = '/pages/API/websocket/socketTask' describe('ExtApi-WebSocket', () => { diff --git a/pages/API/websocket/websocket-socketTask.uvue b/pages/API/websocket/socketTask.uvue similarity index 100% rename from pages/API/websocket/websocket-socketTask.uvue rename to pages/API/websocket/socketTask.uvue diff --git a/pages/API/websocket/websocket.uvue b/pages/API/websocket/websocket.uvue index ab58c5c5..4db59145 100644 --- a/pages/API/websocket/websocket.uvue +++ b/pages/API/websocket/websocket.uvue @@ -13,6 +13,9 @@ 断开websocket服务 发送消息后会收到一条服务器返回的消息(与发送的消息内容一致) + @@ -142,6 +145,11 @@ }, } as CloseSocketOptions) }, + goSocketTask() { + uni.navigateTo({ + url: '/pages/API/websocket/socketTask', + }) + } }, } diff --git a/pages/pages.test.js b/pages/pages.test.js index d22b57f6..6a72e373 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -141,7 +141,7 @@ const pages = [ '/pages/API/request/request', '/pages/API/upload-file/upload-file', '/pages/API/download-file/download-file', - '/pages/API/websocket/websocket-socketTask', + '/pages/API/websocket/socketTask', // 页面销毁时会关闭socket连接,所以规避 // '/pages/API/websocket/websocket', '/pages/API/unicloud/unicloud/cloud-function', -- GitLab