站点图标与logo分开添加与展示

This commit is contained in:
chc
2022-12-22 15:17:13 +08:00
parent 2e4246e63b
commit d9e1a4a491
7 changed files with 119 additions and 96 deletions

View File

@@ -134,7 +134,7 @@ export default {
document.querySelector("link[rel*='icon']") ||
document.createElement("link");
link.type = "image/x-icon";
link.href = localStorage.getItem("icon");
link.href = localStorage.getItem("domainIcon");
link.rel = "shortcut icon";
document.getElementsByTagName("head")[0].appendChild(link);
window.document.title = localStorage.getItem("title") + " - 运营后台";

View File

@@ -43,7 +43,7 @@ export default {
getSite() {
//获取domainLogo
getBaseSite().then((res) => {
const { domainLogo, siteName } = JSON.parse(res.result.settingValue);
const { domainLogo, domainIcon, siteName } = JSON.parse(res.result.settingValue);
this.domainLogo = domainLogo;
// 过期时间
var expirationTime = new Date().setHours(new Date().getHours() + 1);
@@ -51,6 +51,7 @@ export default {
localStorage.setItem("icontitle_expiration_time", expirationTime);
// 存放信息
localStorage.setItem("icon", domainLogo);
localStorage.setItem("domainIcon", domainIcon);
localStorage.setItem("title", siteName);
let link =
document.querySelector("link[rel*='icon']") ||

View File

@@ -18,6 +18,14 @@
<Button @click="onClickImg('domainLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="后台Icon" prop="domainIcon">
<div class="label-item-upload">
<img v-if="formValidate.domainIcon" class="img" :src="formValidate.domainIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('domainIcon')">选择图片</Button>
</div>
</FormItem>
<FormItem label="买家端Logo" prop="buyerSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.buyerSideLogo" class="img" :src="formValidate.buyerSideLogo" />
@@ -25,6 +33,13 @@
<Button @click="onClickImg('buyerSideLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="买家端Icon" prop="buyerSideIcon">
<div class="label-item-upload">
<img v-if="formValidate.buyerSideIcon" class="img" :src="formValidate.buyerSideIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('buyerSideIcon')">选择图片</Button>
</div>
</FormItem>
<FormItem label="商家端Logo" prop="storeSideLogo">
<div class="label-item-upload">
<img v-if="formValidate.storeSideLogo" class="img" :src="formValidate.storeSideLogo" />
@@ -32,6 +47,13 @@
<Button @click="onClickImg('storeSideLogo')">选择图片</Button>
</div>
</FormItem>
<FormItem label="商家端Icon" prop="storeSideIcon">
<div class="label-item-upload">
<img v-if="formValidate.storeSideIcon" class="img" :src="formValidate.storeSideIcon" />
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
<Button @click="onClickImg('storeSideIcon')">选择图片</Button>
</div>
</FormItem>
<FormItem label="站点地址" prop="staticPageAddress">
<Input v-model="formValidate.staticPageAddress" />