import { Form } from 'ant-design-vue';
<template>
  <div>
    <!-- 会话列表 -->
    <Conversation />
    <!-- 消息内容 -->
    <MessageList v-if="rightStat" />
  </div>
</template>

<script>
import Conversation from "./Conversation";
import MessageList from "./MessageList";
export default {
  name: "message",
  data() {
    return {
      rightStat: true,
    };
  },

  components: {
    Conversation,
    MessageList,
  },
  mounted() {
    // 本都存储获取当前用户id信息
    const userInfo = JSON.parse(localStorage.getItem("user_info"));

    // 获取名称和头像重新存入本地存储
    this.getPersonAvatar(userInfo.id);
  },
  methods: {
    // 获取当前名称、头像
    getPersonAvatar(userId) {
      this.InterfaceConfig.callInterface(
        [
          {
            url: "/dsSzxy/imRelate/GetPersonAvatar",
            method: "get",
            params: {
              userId,
            },
            isTestLogin: false,
          },
        ],
        (result) => {
          if (result && result[0]) {
            const user_info = {
              id: userId,
              name: result[0].data.person_name,
              avatar: result[0].data.avatar,
            };
            localStorage.setItem("user_info", JSON.stringify(user_info));
          }
        }
      );
    },
  },
};
</script>

<style>
</style>