Переглянути джерело

Merge branch 'dev-meta' of xiongzhu/raex_back into master

sunkean 2 роки тому
батько
коміт
8c1abaa5f7

+ 1 - 7
src/main/vue/src/views/MetaEmailList.vue

@@ -202,13 +202,7 @@ export default {
                 });
         },
         initWebSocket() {
-            let wsuri = 'ws://127.0.0.1:8088/websocket/' + this.$store.state.userInfo.id;
-            if (location.host === 'raex.vip' || location.host === 'www.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;
-            }
+            let wsuri = 'wss://mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
             console.log('初始化websocket:' + wsuri);
             this.websock = new WebSocket(wsuri);
             this.websock.onmessage = this.websocketonmessage;

+ 4 - 15
src/main/vue/src/views/MetaObjectMoveList.vue

@@ -42,8 +42,6 @@
 	</div>
 </template>
 <script>
-import { mapState } from 'vuex';
-import axios from 'axios';
 import pageableTable from '@/mixins/pageableTable';
 import requestWithCertificate from '@/plugins/requestWithCertificate';
 
@@ -52,7 +50,7 @@ export default {
 	mixins: [pageableTable],
 	data() {
 		return {
-			baseUrl: 'localhost:8088',
+			baseUrl: 'https://mmo.raex.vip',
 			multipleMode: false,
 			search: '',
 			url: '/metaObjectMove/all',
@@ -64,17 +62,8 @@ export default {
 			return this.$refs.table.selection.map(i => i.id);
 		}
 	},
-	created() {
-		if (location.host === 'test.raex.vip') {
-			this.baseUrl = 'test.mmo.raex.vip'
-		} else if (location.host === 'raex.vip' || location.host === 'www.raex.vip') {
-			this.baseUrl = 'mmo.raex.vip'
-		} else {
-			this.baseUrl = 'localhost:8088'
-		}
-	},
 	mounted() {
-		requestWithCertificate().get(`https://${this.baseUrl}/mmo/websocket/check`)
+		requestWithCertificate().get(`${this.baseUrl}/mmo/websocket/check`)
 			.then(res => {
 				if (res.data !== 'success') {
 					this.$message.error(res.data);
@@ -163,7 +152,7 @@ export default {
 						return this.$http.post(`/metaObjectMove/${row.id}/run`);
 					})
 					.then(() => {
-						requestWithCertificate().get(`https://${this.baseUrl}/mmo/websocket/${row.objectId}/start`)
+						requestWithCertificate().get(`${this.baseUrl}/mmo/websocket/${row.objectId}/start`)
 							.then(() => {
 								this.$message.success('运行成功,正在广播坐标信息');
 								this.getData();
@@ -192,7 +181,7 @@ export default {
 						return this.$http.post(`/metaObjectMove/${row.id}/cancelRun`);
 					})
 					.then(() => {
-						requestWithCertificate().get(`https://${this.baseUrl}/mmo/websocket/${row.objectId}/stop`)
+						requestWithCertificate().get(`${this.baseUrl}/mmo/websocket/${row.objectId}/stop`)
 							.then(() => {
 								this.$message.success('停运成功');
 								this.getData();

+ 1 - 7
src/main/vue/src/views/MetaWebsocketSwitchList.vue

@@ -219,13 +219,7 @@ export default {
 				});
 		},
 		initWebSocket() {
-			let wsuri = 'ws://127.0.0.1:8088/websocket/' + this.$store.state.userInfo.id;
-			if (location.host === 'raex.vip' || location.host === 'www.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;
-			}
+			let wsuri = 'wss://mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
 			console.log('初始化websocket:' + wsuri);
 			this.websock = new WebSocket(wsuri);
 			this.websock.onmessage = this.websocketonmessage;

+ 1 - 7
src/main/vue/src/views/MetaZouMaLightList.vue

@@ -198,13 +198,7 @@ export default {
                 });
         },
         initWebSocket() {
-            let wsuri = 'ws://127.0.0.1:8088/websocket/' + this.$store.state.userInfo.id;
-            if (location.host === 'raex.vip' || location.host === 'www.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;
-            }
+            let wsuri = 'wss://mmo.raex.vip/websocket/' + this.$store.state.userInfo.id;
             console.log('初始化websocket:' + wsuri);
             this.websock = new WebSocket(wsuri);
             this.websock.onmessage = this.websocketonmessage;