修改获取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 = ()=>{
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 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();