From 4a800a8fc83c6bd1f86a8e847b079a51a7532c09 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 20 七月 2022 15:05:58 +0800 Subject: [PATCH] 修复国标配置的bug --- src/pages/desktop/index/App.vue | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pages/desktop/index/App.vue b/src/pages/desktop/index/App.vue index a3b84ef..023e7ee 100644 --- a/src/pages/desktop/index/App.vue +++ b/src/pages/desktop/index/App.vue @@ -1,7 +1,7 @@ <template> <div id="app" @contextmenu.prevent> - <tools @jumpToDock="onJumpToDock"></tools> - <desktop ref="desktop"></desktop> + <tools ref="tools" @jumpToDock="onJumpToDock"></tools> + <desktop @quit="quit" ref="desktop"></desktop> <tools-entry @changeBackground="onChangeBg" ref="dock_model"></tools-entry> <notice-tip ref="notice_tip_model"></notice-tip> <notification-center></notification-center> @@ -18,6 +18,7 @@ import { getServerName } from "./api.ts"; import { getApps } from "@/api/app"; +import { getDevInfo } from "@/api/login"; import config from "../../../../package.json"; @@ -48,11 +49,15 @@ return false; }, defaultBgUrl() { - return JSON.parse(sessionStorage.getItem("userInfo")).backgroundpic; + if (JSON.parse(sessionStorage.getItem("userInfo"))) { + return JSON.parse(sessionStorage.getItem("userInfo")).backgroundpic; + } + return ""; }, }, created() { this.getServerName(); + this.getDevInfo(); }, mounted() { document.getElementById("app").style.backgroundImage = `url(${ @@ -103,6 +108,9 @@ }); }, methods: { + quit() { + this.$refs.tools.toLogout(); + }, onJumpToDock(name) { this.$refs.dock_model.onJumpToDock(name); }, @@ -211,6 +219,12 @@ sessionStorage.setItem("title", res.data.serverName); } }, + async getDevInfo() { + const res = await getDevInfo(); + if (res && res.success && res.data.deviceType.substr(0, 2) === "DS") { + sessionStorage.setItem("isShowPolling", "show"); + } + }, }, }; </script> -- Gitblit v1.8.0