import BaseACTION from './base_action'
import { Other } from '@api'

export default class OtherAction extends BaseACTION {
  /* 获取我的消息信息 */
  getMyMsg () {
    return Other.getMyMsg().then(res => {
      const json = res.map(function (_, i) {
        return {
          isRead: false,
          id: _.id,
          text: _.message_body,
          time: _.created_time,
          isShow: false // 该字段用来做 每条信息的打开、关闭
        }
      })
      return json
    })
  }

  /**
   * 文件上传
   */
  uploadFile (obj) { return Other.uploadFile(obj).then(res => res) }
  /**
   * 调用个人信心 - 修改密码
   */
  updatePwd (obj) { return Other.updatePwd(obj).then(res => res) }
}
