gscrequest.ts 511 Bytes
/**
 * GSC 请求封装
 */
import { getGscApi } from './center';

export const gscPost = (url: string, data: any, _config = {}) => {
  const gscApi = getGscApi();

  if (!gscApi) {
    const error = new Error(
      '[GSC请求] GSC API 实例未初始化,请确保配置中心已加载完成',
    );
    console.error(error);
    return Promise.reject(error);
  }

  console.log('[GSC请求] 发起请求:', url, data);
  return gscApi.post(url, data, _config);
};

// 默认导出
export default gscPost;