Skip to content

Commit 10bb286

Browse files
committed
update: 更新websocket示例
1 parent f72430a commit 10bb286

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pages/API/websocket-global/websocket-global.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
onUnload() {
4141
uni.closeSocket()
42+
uni.hideLoading()
4243
},
4344
methods: {
4445
connect() {
@@ -153,7 +154,7 @@
153154
line-height: 40px;
154155
color: #666666;
155156
}
156-
157+
157158
.websocket-tips{
158159
padding: 40px 0px;
159160
text-align: center;

pages/API/websocket-socketTask/websocket-socketTask.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
if (this.socketTask && this.socketTask.close) {
4242
this.socketTask.close()
4343
}
44+
uni.hideLoading()
4445
},
4546
methods: {
4647
connect() {
@@ -70,12 +71,12 @@
7071
// #ifdef MP-WEIXIN
7172
method: 'GET',
7273
// #endif
73-
success(res) {
74-
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
75-
},
76-
fail(err) {
77-
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
78-
}
74+
// success(res) {
75+
// // 这里是接口调用成功的回调,不是连接成功的回调,请注意
76+
// },
77+
// fail(err) {
78+
// // 这里是接口调用失败的回调,不是连接失败的回调,请注意
79+
// }
7980
})
8081
this.socketTask.onOpen((res) => {
8182
this.connecting = false

0 commit comments

Comments
 (0)