diff --git a/src/view/post/Index.vue b/src/view/post/Index.vue index 9e7bff2581a6f08e4054b9733a983ae44884aa74..3ab24d6bb21b9062bcf7485826901f535ca603e8 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 f6cde74215d297d85b3557a816fa01351d2f4885..12793b38c7fe5c05125a196e0984ea272ec52fa2 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(); });