guhongwei hace 4 años
padre
commit
81af1c4ab2
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6 6
      src/components/parts/chat.vue

+ 6 - 6
src/components/parts/chat.vue

@@ -102,16 +102,16 @@ export default {
       }
     },
     async sendEmotion(type) {
+      console.log('1');
+      console.log(this.user);
       let object = { sender_name: this.user.name ? this.user.name : this.user.adminuser, dock_id: this.dock_id };
       let content = '';
       content = `<img src='${_.get(this, `${type}`)}' style="width:30px;height:30px" />`;
       object.content = content;
-      if (this.user.uid) {
-        object.sender_id = this.user.uid;
-        object.role = this.user.role;
-        let res = await this.create(object);
-        this.$checkRes(res, null, res.errmsg || '发言失败');
-      }
+      object.sender_id = this.user ? this.user.uid : this.user.suid;
+      object.role = this.user.role;
+      let res = await this.create(object);
+      this.$checkRes(res, null, res.errmsg || '发言失败');
     },
     isEmotion(word) {
       return word.startsWith('<img');