Explorar el Código

通知socket调整

sunkean hace 3 años
padre
commit
fbf9376fb7

+ 8 - 0
src/main/java/com/izouma/nineth/config/MetaConstants.java

@@ -0,0 +1,8 @@
+package com.izouma.nineth.config;
+
+import java.util.List;
+
+public interface MetaConstants {
+
+    List<Long> GAME_COPY_IDS = List.of(8746067L, 8734418L, 8734417L);
+}

+ 1 - 1
src/main/java/com/izouma/nineth/domain/Snapshot.java

@@ -17,7 +17,7 @@ import javax.persistence.Enumerated;
 @AllArgsConstructor
 @AllArgsConstructor
 @NoArgsConstructor
 @NoArgsConstructor
 @Entity
 @Entity
-@ApiModel("元宇宙玩家领取任务情况")
+@ApiModel("元宇宙快照")
 public class Snapshot extends BaseEntity {
 public class Snapshot extends BaseEntity {
 
 
     @ApiModelProperty("快照名称")
     @ApiModelProperty("快照名称")

+ 21 - 2
src/main/java/com/izouma/nineth/repo/MetaGameProcessRepo.java

@@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.jpa.repository.Query;
 
 
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 
 
 public interface MetaGameProcessRepo extends JpaRepository<MetaGameProcess, Long>, JpaSpecificationExecutor<MetaGameProcess> {
 public interface MetaGameProcessRepo extends JpaRepository<MetaGameProcess, Long>, JpaSpecificationExecutor<MetaGameProcess> {
@@ -19,6 +20,24 @@ public interface MetaGameProcessRepo extends JpaRepository<MetaGameProcess, Long
     @Query(value = "select sum(m.point) from MetaGameProcess m where m.userId = ?1 and m.metaGameCopyId in ?2 and m.del = false")
     @Query(value = "select sum(m.point) from MetaGameProcess m where m.userId = ?1 and m.metaGameCopyId in ?2 and m.del = false")
     Long sumPoint(Long userId, List<Long> metaGameCopyIds);
     Long sumPoint(Long userId, List<Long> metaGameCopyIds);
 
 
-    @Query(value = " SELECT new com.izouma.nineth.dto.SnapshotDTO(m.userId, u.nickname, u.phone, 0) FROM (SELECT user_id userId , sum( point ) point FROM meta_game_process WHERE meta_game_copy_id IN ?2) m LEFT JOIN user u ON m.userId = u.id WHERE m.point > ?1", nativeQuery = true)
-    List<SnapshotDTO> snapshot(int point, List<Long> metaGameCopyIds);
+    @Query(value = " SELECT  new com.izouma.nineth.dto.SnapshotDTO(" +
+            "m.userId," +
+            "u.nickname," +
+            "u.phone," +
+            "0 )" +
+            "FROM" +
+            "( SELECT user_id userId, sum( point ) point FROM meta_game_process WHERE meta_game_copy_id IN ?2 AND created_at <= ?3 GROUP BY user_id ) m" +
+            "LEFT JOIN USER u ON m.userId = u.id " +
+            "WHERE" +
+            "m.point > ?1 " +
+            "AND m.userId NOT IN (" +
+            "SELECT" +
+            "m.userId userId " +
+            "FROM" +
+            "( SELECT user_id userId, sum( point ) point FROM meta_game_process WHERE meta_game_copy_id IN ?2 AND created_at <= ?3 GROUP BY user_id ) m" +
+            "LEFT JOIN USER u ON m.userId = u.id " +
+            "WHERE" +
+            "m.point > ?1 " +
+            ")", nativeQuery = true)
+    List<SnapshotDTO> snapshot(int point, List<Long> metaGameCopyIds, LocalDateTime createdAt, LocalDateTime lastCreatedAt);
 }
 }

+ 9 - 4
src/main/java/com/izouma/nineth/web/SnapshotController.java

@@ -1,5 +1,6 @@
 package com.izouma.nineth.web;
 package com.izouma.nineth.web;
 
 
+import com.izouma.nineth.config.MetaConstants;
 import com.izouma.nineth.domain.Snapshot;
 import com.izouma.nineth.domain.Snapshot;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.SnapshotDTO;
 import com.izouma.nineth.dto.SnapshotDTO;
@@ -15,6 +16,9 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.List;
 
 
 @RestController
 @RestController
@@ -44,12 +48,13 @@ public class SnapshotController extends BaseController {
     public void snapshot(HttpServletResponse response, Long id, String sqlParams) throws IOException {
     public void snapshot(HttpServletResponse response, Long id, String sqlParams) throws IOException {
         if (1L == id) {
         if (1L == id) {
             int point = sysConfigService.getInt("zombie_point");
             int point = sysConfigService.getInt("zombie_point");
-//            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-//            LocalDateTime startTime = LocalDate.parse(sqlParams, formatter).atStartOfDay();
-            List<SnapshotDTO> snapshot = metaGameProcessRepo.snapshot(point, List.of(8746067L, 8734418L, 8734417L));
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            LocalDateTime endTime = LocalDate.parse(sqlParams, formatter).atStartOfDay();
+            LocalDateTime lastEndTime = endTime.plusDays(-1);
+            List<SnapshotDTO> snapshot = metaGameProcessRepo.snapshot(point, MetaConstants.GAME_COPY_IDS, endTime, lastEndTime);
             ExcelUtils.export(response, snapshot);
             ExcelUtils.export(response, snapshot);
         }
         }
-    }
 
 
+    }
 }
 }
 
 

+ 233 - 242
src/main/vue/src/views/MetaEmailList.vue

@@ -1,252 +1,243 @@
 <template>
 <template>
-    <div class="list-view">
-        <page-title>
-            <el-button
-                @click="addRow"
-                type="primary"
-                icon="el-icon-plus"
-                :disabled="fetchingData || downloading"
-                class="filter-item"
-            >
-                新增
-            </el-button>
-            <el-button
-                @click="download"
-                icon="el-icon-upload2"
-                :loading="downloading"
-                :disabled="fetchingData"
-                class="filter-item"
-            >
-                导出
-            </el-button>
-        </page-title>
-        <div class="filters-container">
-            <el-input
-                placeholder="搜索..."
-                v-model="search"
-                clearable
-                class="filter-item search"
-                @keyup.enter.native="getData"
-            >
-                <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
-            </el-input>
-        </div>
-        <el-table
-            :data="tableData"
-            row-key="id"
-            ref="table"
-            header-row-class-name="table-header-row"
-            header-cell-class-name="table-header-cell"
-            row-class-name="table-row"
-            cell-class-name="table-cell"
-            :height="tableHeight"
-            v-loading="fetchingData"
-        >
-            <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
-            <el-table-column prop="id" align="center" label="ID" width="100"> </el-table-column>
-            <el-table-column prop="title" align="center" label="邮件标题" width="200"> </el-table-column>
-            <el-table-column prop="author" align="center" label="邮件作者" width="100"> </el-table-column>
-            <el-table-column prop="description" align="center" label="邮件内容"> </el-table-column>
-            <el-table-column prop="publish" align="center" label="是否发布" width="80">
-                <template slot-scope="{ row }">
-                    <el-tag :type="row.publish ? '' : 'info'"> {{ row.publish }} </el-tag>
-                </template>
-            </el-table-column>
-            <el-table-column label="操作" align="center" fixed="right" width="300">
-                <template slot-scope="{ row }">
-                    <el-button @click="publish(row)" type="primary" size="mini" plain v-if="row && !row.publish">
-                        发布
-                    </el-button>
-                    <el-button @click="editRow(row)" type="primary" size="mini" plain v-if="row && !row.publish">
-                        编辑
-                    </el-button>
-                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain v-if="row && !row.publish">
-                        删除
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-        <div class="pagination-wrapper">
-            <el-pagination
-                background
-                @size-change="onSizeChange"
-                @current-change="onCurrentChange"
-                :current-page="page"
-                :page-sizes="[10, 20, 30, 40, 50]"
-                :page-size="pageSize"
-                layout="total, sizes, prev, pager, next, jumper"
-                :total="totalElements"
-            >
-            </el-pagination>
-        </div>
-    </div>
+	<div class="list-view">
+		<page-title>
+			<el-button
+				@click="addRow"
+				type="primary"
+				icon="el-icon-plus"
+				:disabled="fetchingData || downloading"
+				class="filter-item"
+			>
+				新增
+			</el-button>
+			<el-button
+				@click="download"
+				icon="el-icon-upload2"
+				:loading="downloading"
+				:disabled="fetchingData"
+				class="filter-item"
+			>
+				导出
+			</el-button>
+		</page-title>
+		<div class="filters-container">
+			<el-input
+				placeholder="搜索..."
+				v-model="search"
+				clearable
+				class="filter-item search"
+				@keyup.enter.native="getData"
+			>
+				<el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
+			</el-input>
+		</div>
+		<el-table
+			:data="tableData"
+			row-key="id"
+			ref="table"
+			header-row-class-name="table-header-row"
+			header-cell-class-name="table-header-cell"
+			row-class-name="table-row"
+			cell-class-name="table-cell"
+			:height="tableHeight"
+			v-loading="fetchingData"
+		>
+			<el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
+			<el-table-column prop="id" align="center" label="ID" width="100"> </el-table-column>
+			<el-table-column prop="title" align="center" label="邮件标题" width="200"> </el-table-column>
+			<el-table-column prop="author" align="center" label="邮件作者" width="100"> </el-table-column>
+			<el-table-column prop="description" align="center" label="邮件内容"> </el-table-column>
+			<el-table-column prop="publish" align="center" label="是否发布" width="80">
+				<template slot-scope="{ row }">
+					<el-tag :type="row.publish ? '' : 'info'"> {{ row.publish }} </el-tag>
+				</template>
+			</el-table-column>
+			<el-table-column label="操作" align="center" fixed="right" width="300">
+				<template slot-scope="{ row }">
+					<el-button @click="publish(row)" type="primary" size="mini" plain v-if="row && !row.publish">
+						发布
+					</el-button>
+					<el-button @click="editRow(row)" type="primary" size="mini" plain v-if="row && !row.publish">
+						编辑
+					</el-button>
+					<el-button @click="deleteRow(row)" type="danger" size="mini" plain v-if="row && !row.publish">
+						删除
+					</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+		<div class="pagination-wrapper">
+			<el-pagination
+				background
+				@size-change="onSizeChange"
+				@current-change="onCurrentChange"
+				:current-page="page"
+				:page-sizes="[10, 20, 30, 40, 50]"
+				:page-size="pageSize"
+				layout="total, sizes, prev, pager, next, jumper"
+				:total="totalElements"
+			>
+			</el-pagination>
+		</div>
+	</div>
 </template>
 </template>
 <script>
 <script>
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import pageableTable from '@/mixins/pageableTable';
 import pageableTable from '@/mixins/pageableTable';
 
 
 export default {
 export default {
-    name: 'MetaEmailList',
-    mixins: [pageableTable],
-    data() {
-        return {
-            connected: false,
-            timer: null,
-            websock: null,
-            multipleMode: false,
-            search: '',
-            url: '/metaEmail/all',
-            downloading: false
-        };
-    },
-    created() {
-        // 初始化websocket
-        this.initWebSocket();
-    },
-    destroyed() {
-        window.clearInterval(this.timer);
-        //离开路由之后断开websocket连接
-        this.websock.close();
-    },
-    computed: {
-        selection() {
-            return this.$refs.table.selection.map(i => i.id);
-        }
-    },
-    methods: {
-        beforeGetData() {
-            return { search: this.search, query: { del: false } };
-        },
-        toggleMultipleMode(multipleMode) {
-            this.multipleMode = multipleMode;
-            if (!multipleMode) {
-                this.$refs.table.clearSelection();
-            }
-        },
-        addRow() {
-            this.$router.push({
-                path: '/metaEmailEdit',
-                query: {
-                    ...this.$route.query
-                }
-            });
-        },
-        editRow(row) {
-            this.$router.push({
-                path: '/metaEmailEdit',
-                query: {
-                    id: row.id
-                }
-            });
-        },
-        download() {
-            this.downloading = true;
-            this.$axios
-                .get('/metaEmail/excel', {
-                    responseType: 'blob',
-                    params: { size: 10000 }
-                })
-                .then(res => {
-                    console.log(res);
-                    this.downloading = false;
-                    const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
-                    const link = document.createElement('a');
-                    link.href = downloadUrl;
-                    link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
-                    document.body.appendChild(link);
-                    link.click();
-                    link.remove();
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.downloading = false;
-                    this.$message.error(e.error);
-                });
-        },
-        deleteRow(row) {
-            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
-                .then(() => {
-                    return this.$http.post(`/metaEmail/del/${row.id}`);
-                })
-                .then(() => {
-                    this.$message.success('删除成功');
-                    this.getData();
-                })
-                .catch(e => {
-                    if (e !== 'cancel') {
-                        this.$message.error(e.error);
-                    }
-                });
-        },
-        publish(row) {
-            if (!this.connected) {
-                this.$message.error('当前socket连接异常');
-                return;
-            }
-            this.$alert('邮件发布之后不能编辑和删除,请确定是否发布邮件!', '提示', { type: 'info' })
-                .then(() => {
-                    this.$http.post(`/metaEmail/${row.id}/publish`);
-                    this.websocketsend(JSON.stringify({ type: 'META_WEBSOCKET_NOTICE_EMAIL_NOTICE' }));
-                    return;
-                })
-                .then(() => {
-                    setTimeout(() => {
-                        this.$message.success('发布成功');
-                        this.getData();
-                    }, 1000);
-                })
-                .catch(e => {
-                    if (e !== 'cancel') {
-                        this.$message.error(e.error);
-                    }
-                });
-        },
-        initWebSocket() {
-            let wsuri = 'ws://127.0.0.1:8088/websocket/' + this.$store.state.userInfo.id;
-            if (location.host === 'raex.vip') {
-                wsuri = 'wss://mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
-            }
-            if (location.host === 'test.raex.vip') {
-                wsuri = 'wss://test.mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
-            }
-            console.log('初始化websocket:' + wsuri);
-            this.websock = new WebSocket(wsuri);
-            this.websock.onmessage = this.websocketonmessage;
-            this.websock.onopen = this.websocketonopen;
-            this.websock.onerror = this.websocketonerror;
-            this.websock.onclose = this.websocketclose;
-        },
-        websocketonopen() {
-            this.websocketsend('META_PING');
-            this.timer = window.setInterval(() => {
-                setTimeout(() => {
-                    this.websocketsend('META_PING');
-                }, 0);
-            }, 10000);
-        },
-        websocketonerror() {
-            this.connected = false;
-            console.log('socket连接异常');
-            this.initWebSocket();
-        },
-        websocketonmessage(e) {
-            console.log('socket接收数据:' + e.data);
-            if (e.data === 'META_PONG') {
-                this.connected = true;
-                return;
-            }
-            this.connected = false;
-            this.initWebSocket();
-        },
-        websocketsend(Data) {
-            console.log('socket发送数据:' + Data);
-            this.websock.send(Data);
-        },
-        websocketclose(e) {
-            this.connected = false;
-            console.log('socket断开连接:', e);
-        }
-    }
+	name: 'MetaEmailList',
+	mixins: [pageableTable],
+	data() {
+		return {
+			timer: null,
+			websock: null,
+			multipleMode: false,
+			search: '',
+			url: '/metaEmail/all',
+			downloading: false
+		};
+	},
+	created() {
+		// 初始化websocket
+		this.initWebSocket();
+	},
+	destroyed() {
+		window.clearInterval(this.timer);
+		//离开路由之后断开websocket连接
+		this.websock.close();
+	},
+	computed: {
+		selection() {
+			return this.$refs.table.selection.map(i => i.id);
+		}
+	},
+	methods: {
+		beforeGetData() {
+			return { search: this.search, query: { del: false } };
+		},
+		toggleMultipleMode(multipleMode) {
+			this.multipleMode = multipleMode;
+			if (!multipleMode) {
+				this.$refs.table.clearSelection();
+			}
+		},
+		addRow() {
+			this.$router.push({
+				path: '/metaEmailEdit',
+				query: {
+					...this.$route.query
+				}
+			});
+		},
+		editRow(row) {
+			this.$router.push({
+				path: '/metaEmailEdit',
+				query: {
+					id: row.id
+				}
+			});
+		},
+		download() {
+			this.downloading = true;
+			this.$axios
+				.get('/metaEmail/excel', {
+					responseType: 'blob',
+					params: { size: 10000 }
+				})
+				.then(res => {
+					console.log(res);
+					this.downloading = false;
+					const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+					const link = document.createElement('a');
+					link.href = downloadUrl;
+					link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
+					document.body.appendChild(link);
+					link.click();
+					link.remove();
+				})
+				.catch(e => {
+					console.log(e);
+					this.downloading = false;
+					this.$message.error(e.error);
+				});
+		},
+		deleteRow(row) {
+			this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+				.then(() => {
+					return this.$http.post(`/metaEmail/del/${row.id}`);
+				})
+				.then(() => {
+					this.$message.success('删除成功');
+					this.getData();
+				})
+				.catch(e => {
+					if (e !== 'cancel') {
+						this.$message.error(e.error);
+					}
+				});
+		},
+		publish(row) {
+			if (!this.websock.readyState === 1) {
+				this.$message.error('当前socket连接异常,请刷新页面重试!');
+				return;
+			}
+			this.$alert('邮件发布之后不能编辑和删除,请确定是否发布邮件!', '提示', { type: 'info' })
+				.then(() => {
+					this.$http.post(`/metaEmail/${row.id}/publish`);
+					this.websocketsend(JSON.stringify({ type: 'META_WEBSOCKET_NOTICE_EMAIL_NOTICE' }));
+					return;
+				})
+				.then(() => {
+					setTimeout(() => {
+						this.$message.success('发布成功');
+						this.getData();
+					}, 1000);
+				})
+				.catch(e => {
+					if (e !== 'cancel') {
+						this.$message.error(e.error);
+					}
+				});
+		},
+		initWebSocket() {
+			let wsuri = 'ws://127.0.0.1:8088/websocket/' + this.$store.state.userInfo.id;
+			if (location.host === 'raex.vip') {
+				wsuri = 'wss://mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
+			}
+			if (location.host === 'test.raex.vip') {
+				wsuri = 'wss://test.mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
+			}
+			console.log('初始化websocket:' + wsuri);
+			this.websock = new WebSocket(wsuri);
+			this.websock.onmessage = this.websocketonmessage;
+			this.websock.onopen = this.websocketonopen;
+			this.websock.onerror = this.websocketonerror;
+			this.websock.onclose = this.websocketclose;
+		},
+		websocketonopen() {
+			this.websocketsend('META_PING');
+			this.timer = window.setInterval(() => {
+				setTimeout(() => {
+					this.websocketsend('META_PING');
+				}, 0);
+			}, 10000);
+		},
+		websocketonerror() {
+			console.log('socket连接异常');
+			this.initWebSocket();
+		},
+		websocketonmessage(e) {
+			console.log('socket接收数据:' + e.data);
+		},
+		websocketsend(Data) {
+			console.log('socket发送数据:' + Data);
+			this.websock.send(Data);
+		},
+		websocketclose(e) {
+			console.log('socket断开连接:', e);
+		}
+	}
 };
 };
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>

+ 2 - 11
src/main/vue/src/views/MetaSwitchList.vue

@@ -102,7 +102,6 @@ export default {
 	mixins: [pageableTable],
 	mixins: [pageableTable],
 	data() {
 	data() {
 		return {
 		return {
-			connected: false,
 			timer: null,
 			timer: null,
 			websock: null,
 			websock: null,
 			multipleMode: false,
 			multipleMode: false,
@@ -191,8 +190,8 @@ export default {
 				});
 				});
 		},
 		},
 		updateStatus(row, status) {
 		updateStatus(row, status) {
-			if (!this.connected) {
-				this.$message.error('当前socket连接异常');
+			if (!this.websock.readyState === 1) {
+				this.$message.error('当前socket连接异常,请刷新页面重试!');
 				return;
 				return;
 			}
 			}
 			this.$alert(status ? '确定要打开此开关吗?' : '确定要关闭此开关吗?', status ? '提示' : '警告', {
 			this.$alert(status ? '确定要打开此开关吗?' : '确定要关闭此开关吗?', status ? '提示' : '警告', {
@@ -243,25 +242,17 @@ export default {
 			}, 10000);
 			}, 10000);
 		},
 		},
 		websocketonerror() {
 		websocketonerror() {
-			this.connected = false;
 			console.log('socket连接异常');
 			console.log('socket连接异常');
 			this.initWebSocket();
 			this.initWebSocket();
 		},
 		},
 		websocketonmessage(e) {
 		websocketonmessage(e) {
 			console.log('socket接收数据:' + e.data);
 			console.log('socket接收数据:' + e.data);
-			if (e.data === 'META_PONG') {
-				this.connected = true;
-				return;
-			}
-			this.connected = false;
-			this.initWebSocket();
 		},
 		},
 		websocketsend(Data) {
 		websocketsend(Data) {
 			console.log('socket发送数据:' + Data);
 			console.log('socket发送数据:' + Data);
 			this.websock.send(Data);
 			this.websock.send(Data);
 		},
 		},
 		websocketclose(e) {
 		websocketclose(e) {
-			this.connected = false;
 			console.log('socket断开连接:', e);
 			console.log('socket断开连接:', e);
 		}
 		}
 	}
 	}

+ 2 - 11
src/main/vue/src/views/MetaZouMaLightList.vue

@@ -84,7 +84,6 @@ export default {
 	mixins: [pageableTable],
 	mixins: [pageableTable],
 	data() {
 	data() {
 		return {
 		return {
-			connected: false,
 			timer: null,
 			timer: null,
 			websock: null,
 			websock: null,
 			multipleMode: false,
 			multipleMode: false,
@@ -173,8 +172,8 @@ export default {
 				});
 				});
 		},
 		},
 		publish(row) {
 		publish(row) {
-			if (!this.connected) {
-				this.$message.error('当前socket连接异常');
+			if (!this.websock.readyState === 1) {
+				this.$message.error('当前socket连接异常,请刷新页面重试!');
 				return;
 				return;
 			}
 			}
 			this.$alert('请确定是否发布!如存在已发布走马灯信息,会将已发布走马灯状态改为未发布。', '提示', {
 			this.$alert('请确定是否发布!如存在已发布走马灯信息,会将已发布走马灯状态改为未发布。', '提示', {
@@ -221,25 +220,17 @@ export default {
 			}, 10000);
 			}, 10000);
 		},
 		},
 		websocketonerror() {
 		websocketonerror() {
-			this.connected = false;
 			console.log('socket连接异常');
 			console.log('socket连接异常');
 			this.initWebSocket();
 			this.initWebSocket();
 		},
 		},
 		websocketonmessage(e) {
 		websocketonmessage(e) {
 			console.log('socket接收数据:' + e.data);
 			console.log('socket接收数据:' + e.data);
-			if (e.data === 'META_PONG') {
-				this.connected = true;
-				return;
-			}
-			this.connected = false;
-			this.initWebSocket();
 		},
 		},
 		websocketsend(Data) {
 		websocketsend(Data) {
 			console.log('socket发送数据:' + Data);
 			console.log('socket发送数据:' + Data);
 			this.websock.send(Data);
 			this.websock.send(Data);
 		},
 		},
 		websocketclose(e) {
 		websocketclose(e) {
-			this.connected = false;
 			console.log('socket断开连接:', e);
 			console.log('socket断开连接:', e);
 		}
 		}
 	}
 	}