no message

This commit is contained in:
2024-04-16 08:59:38 +08:00
parent 32bb8327ef
commit c280ae5b2a
3 changed files with 26 additions and 9 deletions

View File

@@ -96,8 +96,9 @@
<script> <script>
import jxTime from '@components/time.vue' import jxTime from '@components/time.vue'
import jxDialog from '@components/dialog.vue' import jxDialog from '@components/dialog.vue'
import { queryHead } from '@/config/getData2.js' // import { queryHead } from '@/config/getData2.js'
import { updatePass, sysMenuBuild, authLogout } from '@config/getData2.js' import { updatePass, sysMenuBuild, authLogout } from '@config/getData2.js'
import { sendWebsocket, closeWebsocket } from '@/config/websocket.js'
import {encrypt} from '../../../main.js' import {encrypt} from '../../../main.js'
export default { export default {
components: { components: {
@@ -245,9 +246,9 @@ export default {
created () { created () {
this._sysMenuBuild() this._sysMenuBuild()
this._queryHead() this._queryHead()
this.timer = setInterval(() => { // this.timer = setInterval(() => {
this._queryHead() // this._queryHead()
}, this.itime) // }, this.itime)
if (this.menus.length) { if (this.menus.length) {
this.menus.map(el => { this.menus.map(el => {
if (el.router === this.$route.path) { if (el.router === this.$route.path) {
@@ -262,7 +263,8 @@ export default {
} }
}, },
beforeDestroy () { beforeDestroy () {
clearInterval(this.timer) // clearInterval(this.timer)
closeWebsocket(true)
}, },
destroyed () { destroyed () {
clearInterval(this.timer) clearInterval(this.timer)
@@ -354,8 +356,23 @@ export default {
async _authLogout () { async _authLogout () {
await authLogout() await authLogout()
}, },
async _queryHead () { // async _queryHead () {
let res = await queryHead() // let res = await queryHead()
// if (res.code === '1') {
// this.topInfo = res.result
// } else {
// this.toast(res.desc)
// }
// },
_queryHead () {
let getTimestamp = new Date().getTime()
let url = this.$store.getters.baseUrl
url = url.substring(7)
console.log(url)
sendWebsocket('ws://' + url + '/webSocket/SendHomeInfo/' + getTimestamp, {}, this.wsMessage, null)
// sendWebsocket('ws://' + '192.168.10.130:8018' + '/webSocket/SendHomeInfo/' + getTimestamp, {}, this.wsMessage, null)
},
wsMessage (res) {
if (res.code === '1') { if (res.code === '1') {
this.topInfo = res.result this.topInfo = res.result
} else { } else {

View File

@@ -63,7 +63,7 @@ li {
html,body { html,body {
-webkit-text-size-adjust: none; -webkit-text-size-adjust: none;
-webkit-tap-highlight-color: #ffffff; -webkit-tap-highlight-color: #ffffff;
background-color: #ffffff; background-color: #001539;
/* width: 100%; /* width: 100%;
height: 100%; */ height: 100%; */
font-size: 16px; font-size: 16px;

View File

@@ -1,7 +1,7 @@
import * as types from '../types' import * as types from '../types'
import { getStore, setStore } from '@config/utils.js' import { getStore, setStore } from '@config/utils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://47.98.105.245:8018' : 'http://localhost:8018'
const setTime = '5000' const setTime = '5000'
const username = 'admin' const username = 'admin'
const password = '123456' const password = '123456'