const { request_wxrlxf, wx_rlxf } = require("../func/request");

const base_url = wx_rlxf ? 'https://tx.hz-hanghui.com:8088/hanghui-server-platform/api/v1/alipay/' : 'http://192.168.11.11:8081/hanghui-server-platform/api/v1/alipay/'

// 校验token是否有权限调用
const tokenCheck = token => {
    return request_wxrlxf({
        url: `${base_url}token/${token}/check`,
        method: "post",
        type: "application/x-www-form-urlencoded"
    })
}

// 推送用户三要素信息
const pushThree = data => {
  return request_wxrlxf({
      url: `${base_url}user/push`,
      method: "post",
      type: "application/json",
      data
  })
}

// 根据三要素获取访客二维码生成
const visitorQrCode = data => {
  return request_wxrlxf({
      url: '/api/v1/fkj/visitor/qrCode',
      method: "post",
      type: "application/json",
      data
  })
}

module.exports = {
  tokenCheck,
  pushThree,
  visitorQrCode
}
