修改获取logo接口地址

master
mhhhh 2022-05-18 21:53:32 +08:00
parent 706bab7eff
commit 48f3c38fbd
2 changed files with 40 additions and 27 deletions

View File

@ -23,3 +23,8 @@ export const postVerifyImg = (params) => {
export const getLogo = ()=>{ export const getLogo = ()=>{
return getRequest (`${commonUrl}/common/common/logo`); return getRequest (`${commonUrl}/common/common/logo`);
}; };
// 获取系统基础信息
export const getSetsite = () => {
return getRequest(`${commonUrl}/common/common/site`);
};

View File

@ -83,8 +83,8 @@ import messageTip from "./main-components/message-tip.vue";
import circleLoading from "@/views/my-components/lili/circle-loading.vue"; import circleLoading from "@/views/my-components/lili/circle-loading.vue";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import util from "@/libs/util.js"; import util from "@/libs/util.js";
import { getNoticePage, logout, getSetting } from "@/api/index"; import { getNoticePage, logout } from "@/api/index";
import {getLogo} from "@/api/common" import { getLogo, getSetsite } from "@/api/common";
var client; var client;
export default { export default {
@ -130,30 +130,33 @@ export default {
this.sliceNum = 2; this.sliceNum = 2;
} }
//domainLogo //domainLogo
getSetting("BASE_SETTING").then((res) => { getSetsite().then((res) => {
if (res.success) { const { domainLogo, siteName } = JSON.parse(res.result.settingValue);
// console.log(data, "ressss");
//list:res.result.settingValue.join(",")
this.domainLogo = domainLogo;
//icon //icon
this.setStore("icon", res.result.domainLogo); this.setStore("icon", this.domainLogo);
this.domainLogo = res.result.domainLogo; // this.domainLogo = this.domainLogo;
let link = let link =
document.querySelector("link[rel*='icon']") || document.querySelector("link[rel*='icon']") ||
document.createElement("link"); document.ceateElement("link");
link.type = "image/x-icon"; link.type = "image/x-icon";
link.href = res.result.domainLogo; link.href = this.domainLogo;
link.rel = "shortcut icon"; link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link); document.getElementsByTagName("head")[0].appendChild(link);
//siteName //siteName
this.setStore("title", res.result.siteName); this.setStore("title", siteName);
window.document.title = res.result.siteName + " - 运营后台"; window.document.title = siteName + " - 运营后台";
} }),
});
getLogo().then((res) => { getLogo().then((res) => {
if (res.success && res.result.settingValue) { if (res.success && res.result.settingValue) {
let data = JSON.parse(res.result.settingValue); let data = JSON.parse(res.result.settingValue);
console.log(data); console.log(data);
} }
}) });
// //
getNoticePage({}).then((res) => { getNoticePage({}).then((res) => {
if (res.success) { if (res.success) {
@ -199,7 +202,12 @@ export default {
}); });
if (!openpageHasTag) { 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) { $route(to, from) {
this.checkTag(to.name); this.checkTag(to.name);
localStorage.currentPageName = to.name; localStorage.currentPageName = to.name;
} },
}, },
mounted() { mounted() {
this.init(); this.init();