Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

micro-customization-system / e-shield-h5

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • e-shield-h5
  • src
  • api
  • request.js
  • zhangxw's avatar
    项目初始化 · 0e78cabf
    zhangxw committed Jul 08, 2022
    0e78cabf
request.js 460 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import HTTP from "@/utils/http";

const axiosHttp = new HTTP();

function request(data = {}, url, method = "GET") {
  return new Promise((resolve, reject) => {
    var reqMethod =
      method.toLocaleLowerCase() === "get" ? "axiosGet" : "axiosPost";
    axiosHttp[reqMethod]({
      url: url,
      data: data,
      success(data) {
        resolve(data);
      },
      error(error) {
        reject(error);
      },
    });
  });
}

export default request;