From e0a41a90a0d88aa6c6e7c64e338021d6cd17a5da Mon Sep 17 00:00:00 2001 From: taohebin Date: Thu, 9 Nov 2023 15:48:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=94=B9=E4=B8=BA=E7=AE=AD=E5=A4=B4=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/download-file/download-file.uvue | 148 +++++++++--------- pages/API/request/request.uvue | 12 +- .../websocket-global/websocket-global.uvue | 16 +- .../websocket-socketTask.uvue | 20 +-- 4 files changed, 98 insertions(+), 98 deletions(-) diff --git a/pages/API/download-file/download-file.uvue b/pages/API/download-file/download-file.uvue index 0b003864..418d9a7d 100644 --- a/pages/API/download-file/download-file.uvue +++ b/pages/API/download-file/download-file.uvue @@ -1,7 +1,7 @@ + .image-container { + display: flex; + justify-content: center; + align-items: center; + } + \ No newline at end of file diff --git a/pages/API/request/request.uvue b/pages/API/request/request.uvue index 4e1ca7b6..cdf323c6 100644 --- a/pages/API/request/request.uvue +++ b/pages/API/request/request.uvue @@ -190,7 +190,7 @@ sslVerify: false, withCredentials: false, firstIpv4: false, - success(res) { + success: (res) => { if (this.pageVisible) { console.log('request success', JSON.stringify(res.data)) uni.showToast({ @@ -202,7 +202,7 @@ this.res = '请求结果 : ' + JSON.stringify(res); } }, - fail(err) { + fail: (err) => { if (this.pageVisible) { console.log('request fail', err); uni.showModal({ @@ -211,7 +211,7 @@ }); } }, - complete() { + complete: () => { uni.hideLoading() }, }); @@ -229,14 +229,14 @@ sslVerify: false, withCredentials: false, firstIpv4: false, - success() { + success: () => { this.jest_result = true; }, - fail() { + fail: () => { this.jest_result = false; }, }); } } } - + \ No newline at end of file diff --git a/pages/API/websocket-global/websocket-global.uvue b/pages/API/websocket-global/websocket-global.uvue index 72735bc8..014889a9 100644 --- a/pages/API/websocket-global/websocket-global.uvue +++ b/pages/API/websocket-global/websocket-global.uvue @@ -60,10 +60,10 @@ export default { uni.closeSocket({ code: 1000, reason: 'close reason from client', - success(res: any) { + success:(res: any) => { console.log('uni.closeSocket success', res) }, - fail(err: any) { + fail:(err: any) => { console.log('uni.closeSocket fail', err) }, } as CloseSocketOptions) @@ -84,11 +84,11 @@ export default { }) uni.connectSocket({ url: 'ws://websocket.dcloud.net.cn', - success(res: any) { + success:(res: any) => { // 这里是接口调用成功的回调,不是连接成功的回调,请注意 console.log('uni.connectSocket success', res) }, - fail(err: any) { + fail:(err: any) => { // 这里是接口调用失败的回调,不是连接失败的回调,请注意 console.log('uni.connectSocket fail', err) }, @@ -140,10 +140,10 @@ export default { this.platform + ' : ' + parseInt((Math.random() * 10000).toString()).toString(), - success(res: any) { + success:(res: any) => { console.log(res) }, - fail(err: any) { + fail:(err: any) => { console.log(err) }, } as SendSocketMessageOptions) @@ -152,10 +152,10 @@ export default { uni.closeSocket({ code: 1000, reason: 'close reason from client', - success(res: any) { + success:(res: any) => { console.log('uni.closeSocket success', res) }, - fail(err: any) { + fail:(err: any) => { console.log('uni.closeSocket fail', err) }, } as CloseSocketOptions) diff --git a/pages/API/websocket-socketTask/websocket-socketTask.uvue b/pages/API/websocket-socketTask/websocket-socketTask.uvue index 8285294b..d6b16806 100644 --- a/pages/API/websocket-socketTask/websocket-socketTask.uvue +++ b/pages/API/websocket-socketTask/websocket-socketTask.uvue @@ -65,10 +65,10 @@ export default { task.close({ code: 1000, reason: 'close reason from client', - success(res: any) { + success:(res: any) => { console.log('uni.closeSocket success', res) }, - fail(err: any) { + fail:(err: any) =>{ console.log('uni.closeSocket fail', err) }, } as CloseSocketOptions) @@ -89,11 +89,11 @@ export default { }) this.socketTask = uni.connectSocket({ url: 'ws://websocket.dcloud.net.cn', - success(res: any) { + success:(res: any) =>{ // 这里是接口调用成功的回调,不是连接成功的回调,请注意 console.log('uni.connectSocket success', res) }, - fail(err: any) { + fail:(err: any) =>{ // 这里是接口调用失败的回调,不是连接失败的回调,请注意 console.log('uni.connectSocket fail', err) }, @@ -145,10 +145,10 @@ export default { parseInt(Math.random() * 10000 + '').toString() this.socketTask?.send({ data, - success(res: any) { + success:(res: any) =>{ console.log(res) }, - fail(err: any) { + fail:(err: any) =>{ console.log(err) }, } as SendSocketMessageOptions) @@ -157,10 +157,10 @@ export default { this.socketTask?.close({ code: 1000, reason: 'close reason from client', - success(res: any) { + success:(res: any) =>{ console.log('uni.closeSocket success', res) }, - fail(err: any) { + fail:(err: any) =>{ console.log('uni.closeSocket fail', err) }, } as CloseSocketOptions) @@ -184,10 +184,10 @@ export default { parseInt(Math.random() * 10000 + '').toString() this.socketTask?.send({ data, - success(_) { + success:(_) =>{ this.jest_result++ }, - fail(_) { + fail:(_) =>{ this.jest_result = 0 }, } as SendSocketMessageOptions) -- GitLab