zhangzengfei
2022-12-30 804d59e162b72be684d0087a8cd74dbd6fecbf4d
src/pages/desktop/index/App.vue
@@ -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(${
@@ -88,7 +93,6 @@
        this.showApps();
      }
      if (e.data.msg == "checkSN") {
        debugger;
        this.$refs.desktop.validateSn();
      }
      if (e.data.msg === "changeColor") {
@@ -214,6 +218,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>