import request from '@/sheep/request';

export default {
  // 微信相关
  wechat: {
    // 小程序订阅消息
    subscribeTemplate: (params) =>
      request({
        url: 'third/wechat/subscribeTemplate',
        method: 'GET',
        params: {
          platform: 'miniProgram',
        },
        custom: {
          showError: false,
          showLoading: false,
        },
      }),

    // 获取微信小程序码
    getWxacode: async (path, query) => {
      return await request({
        url: '/infra/file/qrCode64',
        method: 'GET',
        data: {
          // scene: query,
          // path,
          // checkPath: false, // TODO 开发环境暂不检查 path 是否存在
          // content: 'http://cdz.huamar.com/zdfs?bindUserId=12345',
          type: '1',
          // width: 800,
          // height: 800,
          // imageFormat: 'png',
        },
      });
    },
  },

  // 苹果相关
  apple: {
    // 第三方登录
    login: (data) =>
      request({
        url: 'third/apple/login',
        method: 'POST',
        data,
        custom: {
          showSuccess: true,
          loadingMsg: '登陆中',
        },
      }),
  },
};