import { http } from '@/utils/http'
import { platform } from '@/utils/platform'
let API = ''
if (process.env.NODE_ENV == 'development' && platform == 'h5') {
  API = '/api'
} else {
  API = ''
}
export interface IFooItem {
  id: string
  name: string
}

/** GET 请求 */
export const getFooAPI = (name: string) => {
  return http.get<IFooItem>('/foo', { name })
}

/** POST 请求 */
export const postFooAPI = (name: string) => {
  return http.post<IFooItem>('/foo', { name }, { name })
}

export interface IFooItem {
  id: string
  name: string
}

// /** POST 请求 */
// export const getAuth = (data) => {
//   return http.post<IFooItem>('/auth', data)
// }

export interface IConfigSys {
  option_name: string
}

/** GET 请求 */
export const getConfigSys = (data: IConfigSys) => {
  return http.get<IConfigSys>(`${API}/api/v1/config/system/base/config/options`, data)
}
