import request from "@/utils/request";

// 微信小程序开始授权
export function beginAuthorize() {
  return request({
    url: "/wechat/third/platform/mini/authorize",
    method: "post"
  });
}

// 获取微信小程序信息
export function getWechatInfo() {
  return request({
    url: "/wechat/third/platform/mini/info",
    method: "get"
  });
}

// 微信公众号开始授权
export function beginOfficialauth() {
  return request({
    url: "/wechat/third/platform/official/authorize",
    method: "post"
  });
}
// 获取微信公众号信息
export function getOfficialauthInfo() {
  return request({
    url: "/wechat/third/platform/official/info",
    method: "get"
  });
}
// 微信小程序授权成功回调
export function miniAppSuccessRun(query) {
  return request({
    url: "/wechat/third/platform/mini/authorize/callback",
    method: "get",
    params: query
  });
}
// 微信公众号授权成功回调
export function officialSuccessRun(query) {
  return request({
    url: "/wechat/third/platform/official/authorize/callback",
    method: "get",
    params: query
  });
}

// // 新增设备时序数据库配置
// export function addTsconfig(data) {
//   return request({
//     url: "/iot/tsconfig",
//     method: "post",
//     data: data
//   });
// }

// // 修改设备时序数据库配置
// export function updateTsconfig(data) {
//   return request({
//     url: "/iot/tsconfig",
//     method: "put",
//     data: data
//   });
// }

// 删除设备时序数据库配置
// export function delTsconfig(id) {
//   return request({
//     url: "/iot/tsconfig/" + id,
//     method: "delete"
//   });
// }
