export const login = () => {
  const promise = new Promise(function (resolve, reject) {
    uni.login({
      provider: 'weixin',
      success: (loginRes) => {
        resolve(loginRes)
      },
      fail: (e) => {
        reject(e)
      }
    })
  })
  return promise
}

export const getUserInfo = () => {
  const promise = new Promise(function (resolve, reject) {
    uni.getUserInfo({
      provider: 'weixin',
      success(infoRes) {
        resolve(infoRes)
      },
      fail(e) {
        reject(e)
      }
    })
  })
  return promise
}
