import http from '@/utils/http'
import { AppDispatch } from '..'

/**
 *前台用户-列表
 */

export const A1_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/user/pageList', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }
      dispatch({ type: 'A1/getList', payload: obj })
    }
  }
}

/**
 * 前台用户-删除
 */
export const A1_APIdel = (id: number) => {
  return http.get(`cms/user/removes/${id}`)
}

/**
 * 前台用户-取消认证
 */
export const A1_APIcancel = (id: number) => {
  return http.get(`cms/user/update/${id}`)
}
