diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php index 4d85b2014..eba99d850 100755 --- a/app/Http/Controllers/Api/DialogController.php +++ b/app/Http/Controllers/Api/DialogController.php @@ -485,6 +485,9 @@ public function top() } $dialogUser->top_at = $dialogUser->top_at ? null : Carbon::now(); $dialogUser->save(); - return Base::retSuccess("success", $dialogId); + return Base::retSuccess("success", [ + 'id' => $dialogUser->dialog_id, + 'top_at' => $dialogUser->top_at?->toDateTimeString(), + ]); } } diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php index b361fa4aa..bea82db36 100755 --- a/app/Http/Controllers/Api/ProjectController.php +++ b/app/Http/Controllers/Api/ProjectController.php @@ -1906,6 +1906,9 @@ public function top() } $projectUser->top_at = $projectUser->top_at ? null : Carbon::now(); $projectUser->save(); - return Base::retSuccess("success", $projectId); + return Base::retSuccess("success", [ + 'id' => $projectUser->project_id, + 'top_at' => $projectUser->top_at?->toDateTimeString(), + ]); } } diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index d9aae5eda..9293d34fa 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -888,16 +888,17 @@ export default { data: { project_id: this.topOperateItem.id, }, - }).then(() => { - this.$store.dispatch("getProjects").then(() => { + }).then(({data}) => { + this.$store.dispatch("saveProject", data); + this.$nextTick(() => { let active = this.$refs.projectWrapper.querySelector(".active") if (active) { $A.scrollToView(active, { - behavior: 'smooth', + behavior: 'instant', scrollMode: 'if-needed', }); } - }).catch(() => {}); + }); }).catch(({msg}) => { $A.modalError(msg); }); diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue index e450f7843..878847774 100644 --- a/resources/assets/js/pages/manage/messenger.vue +++ b/resources/assets/js/pages/manage/messenger.vue @@ -469,9 +469,10 @@ export default { data: { dialog_id: this.topOperateItem.id, }, - }).then(() => { - this.$store.dispatch("getDialogs").then(() => { - this.scrollIntoActive(true) + }).then(({data}) => { + this.$store.dispatch("saveDialog", data); + this.$nextTick(() => { + this.scrollIntoActive(false) }); }).catch(({msg}) => { $A.modalError(msg);