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/scene/list', 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/scene/removes/${id}`)
}

/**
 * 检查登录状态
 */
export const isTokenFlagAPI = () => {
  return http.get('admin/checkLogin')
}

// -------------第三方平台授权登录------------

/**
 * 通过code获取token和别的用户信息
 */
export const API_login = (data: any) => {
  return http.post('admin/ssoLogin', data)
}
