From 0fcf0c273e2b1e6efcd8203a241143342799b151 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 25 Oct 2021 19:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD=EF=BC=8Cbu?= =?UTF-8?q?g=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/header/index.vue | 16 ++++++++-------- src/store/modules/user.js | 20 +++++++++++++++++--- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 12ef807..a1ece1f 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -36,6 +36,7 @@ export default { ]) }, mounted() { + this.getSystemDetail(); this.getUserInfo(); }, methods: { @@ -93,14 +94,13 @@ export default { height: 60px; font-size: 16px; color: #333; -} - -.header .logo { - width: 150px; - margin-left: 20px; - - &.hh { - width: 500px; + .logo { + height: 50px; + margin: 0 20px; + } + .title { + font-size: 18px; + font-weight: bold; } } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index d37bcf7..6578bb3 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -10,6 +10,8 @@ import addRoutes from "@/libs/route/addRoutes"; export default { namespaced: true, state: { + title: "", + logoUrl: "", avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png", userId: "", studentId: "", @@ -28,6 +30,12 @@ export default { state.roleId = info.roleId; state.dataTime = info.dataTime; }, + SET_TITLE: (state, title) => { + state.title = title; + }, + SET_LOGO_URL: (state, logoUrl) => { + state.logoUrl = logoUrl; + }, SET_AVATAR: (state, avatar) => { state.avatar = avatar; }, @@ -68,12 +76,18 @@ export default { resolve(); }); }, - setAvatar({ state, commit }, avatar) { - commit("SET_AVATAR", avatar); - }, setInfo({ state, commit }, info) { commit("SET_INFO", info); }, + setTitle({ state, commit }, title) { + commit("SET_TITLE", title); + }, + setLogoUrl({ state, commit }, logoUrl) { + commit("SET_LOGO_URL", logoUrl); + }, + setAvatar({ state, commit }, avatar) { + commit("SET_AVATAR", avatar); + }, setUserName({ state, commit }, userName) { commit("SET_USERNAME", userName); }