diff --git a/src/views/home/home.vue b/src/views/home/home.vue index 3b70e46..6053f4f 100644 --- a/src/views/home/home.vue +++ b/src/views/home/home.vue @@ -35,7 +35,8 @@ export default { computed: { title() { if (!Number(this.type)) return "欢迎使用幸福人寿生态系统!" - return `亲爱的${this.name}${this.sex == 1 ? '女士' : '先生'}!` + return `亲爱的${this.name}${Number(this.sex) === 1 ? '女士' : + Number(this.sex) === 0 ? '先生' : ''}!` } }, methods: { @@ -59,8 +60,8 @@ export default { fetchUserInfo().then(res => { const { content } = res.content this.name = content.name - this.sex = content.sex - this.type = content.type + this.sex = Number(content.sex) + this.type = Number(content.type) }) } else Dialog({