"use strict";
const common_vendor = require("../common/vendor.js");
const BASE_URL = "https://chtech.ncjti.edu.cn/gradiate-school/reporting";
const myRequest = (options) => {
  common_vendor.index.showLoading({
    title: "加载中",
    mask: true
  });
  return new Promise((resolve, reject) => {
    common_vendor.index.request({
      url: BASE_URL + options.url,
      method: options.method || "GET",
      data: options.data || {},
      success: (res) => {
        common_vendor.index.hideLoading();
        resolve(res.data);
      },
      fail: (err) => {
        common_vendor.index.hideLoading();
        common_vendor.index.showToast({
          title: "请求数据失败",
          icon: "none",
          mask: true
        });
        reject(err);
      }
    });
  });
};
exports.myRequest = myRequest;
