import request from '@/utils/request';
import type { ApiResult } from '@/api';

/**
 * 统一支付
 */
export async function pay(data: any) {
  const res = await request.post<ApiResult<any>>('/payment/create-with-order',data);
  if (res.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.message));
}
