kuaifan 5 лет назад
Родитель
Сommit
b28d120797

+ 3 - 1
app/Http/Controllers/Api/ChatController.php

@@ -143,7 +143,9 @@ class ChatController extends Controller
         $lists = Base::getPageList($lists, false);
         //
         foreach ($lists['lists'] AS $key => $item) {
-            $item = array_merge($item, Users::username2basic($item['username']));
+            $basic = Users::username2basic($item['username']);
+            $item['nickname'] = $basic ? $basic['nickname'] : ($item['nickname'] || '');
+            $item['userimg'] = $basic ? $basic['userimg'] : ($item['userimg'] || '');
             $item['message'] = Base::string2array($item['message']);
             $lists['lists'][$key] = $item;
         }

+ 4 - 0
app/Services/WebSocketService.php

@@ -243,6 +243,10 @@ class WebSocketService implements WebSocketHandlerInterface
                     $data['body']['id'] = $resData['id'];
                     $data['body']['unread'] = $resData['unread'];
                     //
+                    $basic = Users::username2basic($username);
+                    $data['body']['nickname'] = $basic ? $basic['nickname'] : ($data['body']['nickname'] || '');
+                    $data['body']['userimg'] = $basic ? $basic['userimg'] : ($data['body']['userimg'] || '');
+                    //
                     $pushLists = [];
                     foreach ($this->getUserOfName($data['target']) AS $item) {
                         $pushLists[] = [

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-    "version": "1.4.10",
+    "version": "1.4.11",
     "name": "wookteam",
     "private": true,
     "scripts": {

+ 1 - 0
resources/assets/js/main/components/WHeader.vue

@@ -521,6 +521,7 @@
                                     success: (res) => {
                                         if (res.ret === 1) {
                                             $A.getUserInfo(true);
+                                            $A.getUserBasic(this.userInfo.username, () => {}, 0);
                                             this.$Message.success(this.$L('修改成功'));
                                         } else {
                                             this.$Modal.error({title: this.$L('温馨提示'), content: res.msg });

+ 2 - 0
resources/assets/js/main/components/chat/Index.vue

@@ -839,6 +839,8 @@
                 if (this.userInfo.id != res.id) {
                     this.userInfo = res;
                     resCall();
+                } else {
+                    this.userInfo = res;
                 }
             }, false);
             resCall();

+ 2 - 0
resources/assets/js/main/pages/docs.vue

@@ -288,6 +288,8 @@
                 if (this.userInfo.id != res.id) {
                     this.userInfo = res;
                     isLogin && this.getBookLists(true);
+                } else {
+                    this.userInfo = res;
                 }
             }, false);
         },

+ 1 - 3
resources/assets/js/main/pages/docs/edit.vue

@@ -409,9 +409,7 @@
         mounted() {
             this.routeName = this.$route.name;
             this.userInfo = $A.getUserInfo((res, isLogin) => {
-                if (this.userInfo.id != res.id) {
-                    this.userInfo = res;
-                }
+                this.userInfo = res;
             }, false);
             //
             setInterval(() => {

+ 1 - 3
resources/assets/js/main/pages/docs/view.vue

@@ -195,9 +195,7 @@
         mounted() {
             this.routeName = this.$route.name;
             this.userInfo = $A.getUserInfo((res, isLogin) => {
-                if (this.userInfo.id != res.id) {
-                    this.userInfo = res;
-                }
+                this.userInfo = res;
             }, false);
             //
             document.addEventListener("fullscreenchange", () => {

+ 2 - 0
resources/assets/js/main/pages/project.vue

@@ -346,6 +346,8 @@
                 if (this.userInfo.id != res.id) {
                     this.userInfo = res;
                     isLogin && this.getLists(true);
+                } else {
+                    this.userInfo = res;
                 }
             }, false);
             //

+ 2 - 0
resources/assets/js/main/pages/team.vue

@@ -266,6 +266,8 @@
                 if (this.userInfo.id != res.id) {
                     this.userInfo = res;
                     isLogin && this.getLists(true);
+                } else {
+                    this.userInfo = res;
                 }
             }, false);
         },

+ 2 - 0
resources/assets/js/main/pages/todo.vue

@@ -367,6 +367,8 @@
                 if (this.userInfo.id != res.id) {
                     this.userInfo = res;
                     isLogin && this.refreshTask();
+                } else {
+                    this.userInfo = res;
                 }
             }, false);
             //