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

export default class TestAction extends BaseACTION {
  /* get传输方式 */
  getTest (id) {
    return Test.getTest(id).then(res => {
      return res || { test: this.getVueInstance().$t('action.interface') }
    }).catch(res => {
      return res || { test: this.getVueInstance().$t('action.interface') }
    })
  }

  /* post传输方式 */
  postTest (obj = {}) {
    return Test.postTest(obj).then(res => {
      return res || { test: 'OK' }
    }).catch(res => {
      return res || { test: 'OK' }
    })
  }

  /* 当前登录用户，检测是否该系统有权限 */
  getInfo () {
    return Test.getInfo().then(res => {
      return res || { test: 'OK' }
    }).catch(res => {
      return res || { test: 'OK' }
    })
  }
}
