Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce562f5

Browse filesBrowse files
committed
fix: 命名优化
1 parent 7e541c4 commit ce562f5
Copy full SHA for ce562f5

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed

‎src/views/mydemo/WebSocketDemo.vue

Copy file name to clipboardExpand all lines: src/views/mydemo/WebSocketDemo.vue
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: Cherry 2858937488@qq.com
33
* @Date: 2023-03-14 10:40:55
44
* @LastEditors: Cherry 2858937488@qq.com
5-
* @LastEditTime: 2023-03-16 13:47:40
5+
* @LastEditTime: 2023-03-16 20:57:15
66
* @FilePath: \vue3-admin\vue3-element-admin\src\views\mydemo\WebSocketDemo.vue
77
* @Description: websocket
88
-->
@@ -112,6 +112,7 @@ const startConnection = () => {
112112
};
113113
114114
const disconnected = () => {
115+
disabled.value = false;
115116
isConnected.value = false;
116117
destroySocket();
117118
};
@@ -137,11 +138,11 @@ const sendMsg = () => {
137138
138139
const createSocket = () => {
139140
console.log('创建长连接', !socket.value);
140-
const usewebSocketStore = webSocketStore();
141+
const useWebSocketStore = webSocketStore();
141142
const useUserStore = userStore();
142-
const id = usewebSocketStore.getSocketID() || `${useUserStore.userId}-${new Date().getTime() / 1000}`;
143-
if (!usewebSocketStore.getSocketID()) {
144-
usewebSocketStore.setSocketID(id);
143+
const id = useWebSocketStore.getSocketID() || `${useUserStore.userId}-${new Date().getTime() / 1000}`;
144+
if (!useWebSocketStore.getSocketID()) {
145+
useWebSocketStore.setSocketID(id);
145146
}
146147
socket.value = new Socket({
147148
url: linkUrl.value + '/' + id,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.