diff --git a/backend/application/websocketConfig.py b/backend/application/websocketConfig.py index c36d97a..ab2cd64 100644 --- a/backend/application/websocketConfig.py +++ b/backend/application/websocketConfig.py @@ -73,7 +73,7 @@ class DvadminWebSocket(AsyncJsonWebsocketConsumer): unread_count = await _get_message_unread(self.user_id) if unread_count == 0: # 发送连接成功 - await self.send_json(set_message('system', 'SYSTEM', '连接成功')) + await self.send_json(set_message('system', 'SYSTEM', '您已上线')) else: await self.send_json( set_message('system', 'SYSTEM', "请查看您的未读消息~", diff --git a/web/src/App.vue b/web/src/App.vue index ec824fa..caa36ca 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -59,12 +59,6 @@ onBeforeMount(() => { setIntroduction.cssCdn(); // 设置批量第三方 js setIntroduction.jsCdn(); - //websockt 模块 - try { - //websocket.init(wsReceive) - } catch (e) { - console.log('websocket错误'); - } }); // 页面加载时 onMounted(() => { @@ -93,6 +87,14 @@ watch( () => route.path, () => { other.useTitle(); + if (!websocket.websocket) { + //websockt 模块 + try { + websocket.init(wsReceive) + } catch (e) { + console.log('websocket错误'); + } + } }, { deep: true, diff --git a/web/src/i18n/lang/zh-cn.ts b/web/src/i18n/lang/zh-cn.ts index 6fc6ef3..6289a39 100644 --- a/web/src/i18n/lang/zh-cn.ts +++ b/web/src/i18n/lang/zh-cn.ts @@ -40,6 +40,8 @@ export default { title4: '消息', title5: '开全屏', title6: '关全屏', + retry: '重试上线', + onlinePrompt: '当前离线状态,是否重试上线?', dropdownLarge: '大型', dropdownDefault: '默认', dropdownSmall: '小型', @@ -75,7 +77,7 @@ export default { }, noAccess: { accessTitle: '您未被授权,没有操作权限~', - accessMsg: '联系方式:加QQ群探讨 665452019', + accessMsg: '请联系管理员', accessBtn: '重新授权', }, layout: { diff --git a/web/src/i18n/lang/zh-tw.ts b/web/src/i18n/lang/zh-tw.ts index 35e406f..ea00164 100644 --- a/web/src/i18n/lang/zh-tw.ts +++ b/web/src/i18n/lang/zh-tw.ts @@ -123,7 +123,7 @@ export default { }, noAccess: { accessTitle: '您未被授權,沒有操作許可權~', - accessMsg: '聯繫方式:加QQ群探討665452019', + accessMsg: '請聯系管理員', accessBtn: '重新授權', }, layout: { diff --git a/web/src/layout/navBars/breadcrumb/user.vue b/web/src/layout/navBars/breadcrumb/user.vue index f4cf706..620a076 100644 --- a/web/src/layout/navBars/breadcrumb/user.vue +++ b/web/src/layout/navBars/breadcrumb/user.vue @@ -57,9 +57,33 @@ :class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'" > +
+ + + + + +
- + + + + + {{ userInfos.username === '' ? 'common' : userInfos.username }} @@ -79,7 +103,7 @@