diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 6f23bfe..291f360 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -7,7 +7,7 @@
- {{ userName }} + {{ customer ? customerName : userName }}
退出 @@ -21,16 +21,12 @@ import util from "@/libs/util"; export default { data() { return { - title: "", - logoUrl: "" + }; }, computed: { ...mapState("user", [ - "avatar", "userName" - ]), - ...mapState("auth", [ - "routes" + "avatar", "userName", "title", "logoUrl", "customer", "customerName" ]) }, mounted() { @@ -38,16 +34,20 @@ export default { }, methods: { ...mapActions("user", [ - "logout" + "logout", "setTitle", "setLogoUrl" ]), toPersonal() { - this.$router.push("/setting/person"); + if (!this.customer) { + this.$router.push("/setting/person"); + } }, getSystemDetail () { this.$get(this.api.logoDetail).then(res => { - if (res.status === 200 && res.data) { - this.title = res.data.title; - this.logoUrl = res.data.logoUrl; + if (res.status === 200) { + if (res.data) { + this.setTitle(res.data.title); + this.setLogoUrl(res.data.logoUrl); + } } else { util.errorMsg(res.message); } diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index 6b48fee..a1538e8 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -1,10 +1,5 @@