From b9b5d00d91c4516f85957aa96ff51e8938314651 Mon Sep 17 00:00:00 2001 From: hanaabi-shunyou Date: Thu, 10 Jun 2021 13:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=90=8E=E5=A4=B4=E5=83=8F=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84bug=E4=BB=A5=E5=8F=8A=E5=88=86=E9=A1=B5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/post/Index.vue | 9 +++++---- src/view/user/Setting.vue | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/view/post/Index.vue b/src/view/post/Index.vue index 9e7bff2..3ab24d6 100644 --- a/src/view/post/Index.vue +++ b/src/view/post/Index.vue @@ -239,11 +239,11 @@ export default { ...mapGetters(["user"]), }, created() { - this.init(this.tab); + this.init(); }, methods: { - init(tab) { - getList(this.page.current, this.page.size, tab, this.user.id).then((response) => { + init() { + getList(this.page.current, this.page.size, this.activeName, this.user.id).then((response) => { const { data } = response; this.page.current = data.current; this.page.total = data.total; @@ -253,7 +253,8 @@ export default { }, handleClick(tab) { this.page.current = 1; - this.init(tab.name); + this.init(); + this.activeName = tab.name }, }, }; diff --git a/src/view/user/Setting.vue b/src/view/user/Setting.vue index f6cde74..12793b3 100644 --- a/src/view/user/Setting.vue +++ b/src/view/user/Setting.vue @@ -209,7 +209,13 @@ export default { }, submitForm(formName) { console.log(this.user); - update(this.user).then((res) => { + const formUser = { + id: this.user.id, + username: this.user.username, + alias: this.user.alias, + bio: this.user.bio, + } + update(formUser).then((res) => { this.$message.success(this.$t("user.success")); this.fetchInfo(); }); -- Gitee