Forráskód Böngészése

优化全局变量

kuaifan 5 éve
szülő
commit
ff6bf7835a

+ 12 - 14
resources/assets/js/main/components/chat/Index.vue

@@ -3,7 +3,7 @@
         <!--左边选项-->
         <ul class="chat-menu">
             <li class="self">
-                <UserImg :info="userInfo" class="avatar"/>
+                <UserImg :info="usrInfo" class="avatar"/>
             </li>
             <li :class="{active:chatTap=='dialog'}" @click="[chatTap='dialog',chatTam='dialog']">
                 <Icon type="md-text" />
@@ -894,8 +894,6 @@
 
                 openAlready: false,
 
-                userInfo: {},
-
                 chatTap: 'dialog',
                 chatTam: 'dialog',
 
@@ -1496,8 +1494,8 @@
                         filename: item.name,
                         filesize: item.size,
                         filethumb: item.thumb,
-                        username: this.userInfo.username,
-                        userimg: this.userInfo.userimg,
+                        username: this.usrInfo.username,
+                        userimg: this.usrInfo.userimg,
                         indate: Math.round(new Date().getTime() / 1000),
                         url: item.url,
                         width: $A.getObject(item, 'response.data.width'),
@@ -1518,7 +1516,7 @@
             },
 
             addMessageData(data, animation = false, isUnshift = false) {
-                data.self = data.username === this.userInfo.username;
+                data.self = data.username === this.usrInfo.username;
                 let sikp = false;
                 if (data.id || data.replaceId) {
                     this.messageLists.some((item, index) => {
@@ -1585,8 +1583,8 @@
                         this.addMessageData({
                             id: file.tempId,
                             type: 'image',
-                            username: this.userInfo.username,
-                            userimg: this.userInfo.userimg,
+                            username: this.usrInfo.username,
+                            userimg: this.usrInfo.userimg,
                             indate: Math.round(new Date().getTime() / 1000),
                             url: 'loading',
                         }, true);
@@ -1621,8 +1619,8 @@
                 if ($A.count(text) > 0) {
                     let data = {
                         type: 'text',
-                        username: this.userInfo.username,
-                        userimg: this.userInfo.userimg,
+                        username: this.usrInfo.username,
+                        userimg: this.usrInfo.userimg,
                         indate: Math.round(new Date().getTime() / 1000),
                         text: text
                     };
@@ -1706,8 +1704,8 @@
                 $A.WSOB.sendTo('info', this.videoUserName, {
                     'type': 'video',
                     'subtype': 'call',
-                    'username': this.userInfo.username,
-                    'userimg': this.userInfo.userimg,
+                    'username': this.usrInfo.username,
+                    'userimg': this.usrInfo.userimg,
                     'video': this.videoChat,
                 }, (res) => {
                     if (res.status !== 1) {
@@ -1755,8 +1753,8 @@
                         if (second >= 2) {
                             $A.WSOB.sendTo('user', this.videoUserName, {
                                 type: this.videoChat ? 'video' : 'voice',
-                                username: this.userInfo.username,
-                                userimg: this.userInfo.userimg,
+                                username: this.usrInfo.username,
+                                userimg: this.usrInfo.userimg,
                                 indate: Math.round(new Date().getTime() / 1000),
                                 text: this.videoChat ? '视频通话' : '语音通话',
                                 other: {

+ 2 - 3
resources/assets/js/main/components/report/add.vue

@@ -198,11 +198,10 @@
                             this.$emit("on-success", res.data);
                             //
                             if (this.dataDetail.status === '已发送') {
-                                let userInfo = $A.getUserInfo();
                                 let msgData = {
                                     type: 'report',
-                                    username: userInfo.username,
-                                    userimg: userInfo.userimg,
+                                    username: this.usrInfo.username,
+                                    userimg: this.usrInfo.userimg,
                                     indate: Math.round(new Date().getTime() / 1000),
                                     text: this.dataDetail.ccuserAgain ? this.$L('修改了工作报告') : this.$L('发送了工作报告'),
                                     other: {

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

@@ -26,13 +26,13 @@
                         <li class="title">{{$L('正在协作会员')}}:</li>
                         <li v-for="(item, key) in synchUsersS" :key="key" @click="handleSynch(item.username)">
                             <UserView class="synch-username" placement="right" :username="item.username" showimg/>
-                            <span v-if="item.username==userInfo.username" class="synch-self">{{$L('自己')}}</span>
+                            <span v-if="item.username==usrInfo.username" class="synch-self">{{$L('自己')}}</span>
                         </li>
                     </ul>
                 </Poptip>
                 <Tooltip class="header-menu" :class="{lock:isLock}" max-width="500">
                     <div slot="content" style="white-space:nowrap">
-                        <span v-if="isLock&&docDetail.lockname!=userInfo.username">【<UserView :username="docDetail.lockname"/>】{{$L('已锁定')}}</span>
+                        <span v-if="isLock&&docDetail.lockname!=usrInfo.username">【<UserView :username="docDetail.lockname"/>】{{$L('已锁定')}}</span>
                         <span v-else>{{$L('锁定后其他会员将无法修改保存文档。')}}</span>
                     </div>
                     <div class="menu-container" @click="handleClick(isLock?'unlock':'lock')"><Icon :type="isLock?'md-lock':'md-unlock'" /></div>