From 48f3c38fbd6b5636d5e7afd15943cbd22ca75eb2 Mon Sep 17 00:00:00 2001 From: mhhhh Date: Wed, 18 May 2022 21:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96logo?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/api/common.js | 5 +++ manager/src/views/Main.vue | 62 +++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/manager/src/api/common.js b/manager/src/api/common.js index 807a3769..7e0810f6 100644 --- a/manager/src/api/common.js +++ b/manager/src/api/common.js @@ -23,3 +23,8 @@ export const postVerifyImg = (params) => { export const getLogo = ()=>{ return getRequest (`${commonUrl}/common/common/logo`); }; + +// 获取系统基础信息 +export const getSetsite = () => { + return getRequest(`${commonUrl}/common/common/site`); +}; \ No newline at end of file diff --git a/manager/src/views/Main.vue b/manager/src/views/Main.vue index e618b85d..d0c1887d 100644 --- a/manager/src/views/Main.vue +++ b/manager/src/views/Main.vue @@ -83,8 +83,8 @@ import messageTip from "./main-components/message-tip.vue"; import circleLoading from "@/views/my-components/lili/circle-loading.vue"; import Cookies from "js-cookie"; import util from "@/libs/util.js"; -import { getNoticePage, logout, getSetting } from "@/api/index"; -import {getLogo} from "@/api/common" +import { getNoticePage, logout } from "@/api/index"; +import { getLogo, getSetsite } from "@/api/common"; var client; export default { @@ -130,30 +130,33 @@ export default { this.sliceNum = 2; } //获取domainLogo - getSetting("BASE_SETTING").then((res) => { - if (res.success) { - //动态获取icon - this.setStore("icon", res.result.domainLogo); - this.domainLogo = res.result.domainLogo; - let link = - document.querySelector("link[rel*='icon']") || - document.createElement("link"); - link.type = "image/x-icon"; - link.href = res.result.domainLogo; - link.rel = "shortcut icon"; - document.getElementsByTagName("head")[0].appendChild(link); - //动态获取siteName - this.setStore("title", res.result.siteName); - window.document.title = res.result.siteName + " - 运营后台"; - } - }); - getLogo().then((res)=>{ - if(res.success&&res.result.settingValue){ - let data = JSON.parse(res.result.settingValue); + getSetsite().then((res) => { + const { domainLogo, siteName } = JSON.parse(res.result.settingValue); + // console.log(data, "ressss"); - console.log(data); - } - }) + //list:res.result.settingValue.join(",") + this.domainLogo = domainLogo; + //动态获取icon + this.setStore("icon", this.domainLogo); + // this.domainLogo = this.domainLogo; + let link = + document.querySelector("link[rel*='icon']") || + document.ceateElement("link"); + link.type = "image/x-icon"; + link.href = this.domainLogo; + link.rel = "shortcut icon"; + document.getElementsByTagName("head")[0].appendChild(link); + //动态获取siteName + this.setStore("title", siteName); + window.document.title = siteName + " - 运营后台"; + }), + getLogo().then((res) => { + if (res.success && res.result.settingValue) { + let data = JSON.parse(res.result.settingValue); + + console.log(data); + } + }); // 读取未读消息数 getNoticePage({}).then((res) => { if (res.success) { @@ -199,7 +202,12 @@ export default { }); if (!openpageHasTag) { // 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题 - util.openNewPage(this, name, this.$route.params || {}, this.$route.query || {}); + util.openNewPage( + this, + name, + this.$route.params || {}, + this.$route.query || {} + ); } }, //宽度动态计算 @@ -217,7 +225,7 @@ export default { $route(to, from) { this.checkTag(to.name); localStorage.currentPageName = to.name; - } + }, }, mounted() { this.init();