From 7991973cf4c25527e227b80192e0bd087cfcee58 Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期二, 27 九月 2022 18:26:25 +0800 Subject: [PATCH] 完善系统设置的基本设置 --- src/App.vue | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 71c8728..b646426 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,12 +3,51 @@ <router-view /> </div> </template> - -<style > - -</style> <script> -export default { +export default { + data() { + return { + mytitle: '', + } + }, + async created() { + const imgObj = await this.getIcon(); + this.changIcon(imgObj); + }, + methods: { + changIcon(obj) { + var link = document.querySelector("link [rel*='icon']") || document.createElement("link"); + var title = document.querySelector("title") || document.createElement("title"); + link.type = "image/x-icon"; + link.rel = "shortcut icon"; + link.href = obj.chromeLinkUrl; //icon鍥炬爣 + title.innerHTML = obj.title; + document.getElementsByTagName("head")[0].appendChild(link); + document.getElementsByTagName("head")[0].appendChild(title); + }, + // 鑾峰彇icon + async getIcon() { + let result; + const pic = JSON.parse(sessionStorage.getItem('pic')); + if (pic) { + result = pic; + console.log('缂撳瓨') + } else { + console.log('璇锋眰'); + await this.$axios({ + method: 'get', + url: 'sccg/system/portal/logo/search', + }).then(res => { + result = res.data; + sessionStorage.setItem('pic',JSON.stringify(result)); + }) + } + return result; + }, + } }; -</script> \ No newline at end of file +</script> +<style> + +</style> \ No newline at end of file -- Gitblit v1.8.0