import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 病害管理-获取列表
 */
export const A2_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/disease/pageList', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }

      dispatch({ type: 'A2/getList', payload: obj })
    }
  }
}

/**
 * 病害管理-获取token
 */
export const A2_APIgetToken = () => {
  return http.get(`cms/disease/age/getToken`)
}
