import http from '@/service'

// 分享卡片进入
export function shareArticleByIdApi(
  articleId: string,
  shareUserId: string,
  openUserId: string,
  type: string,
  packageId = '',
  sharePicUrl = '',
  remark = ''
) {
  return http.get(
    `/admin/api/shareArticleById?articleId=${articleId}&shareUserId=${shareUserId}&openUserId=${openUserId}&type=${type}&packageId=${packageId}&sharePicUrl=${sharePicUrl}&remark=${remark}`
  )
}

export function getArticleByIdApi(id: string) {
  return http.get(`/admin/api/getArticleById?id=${id}`)
}

export function shareAlbumByIdApi(
  articleId: string,
  shareUserId: string,
  openUserId: string,
  type: string,
  packageId = '',
  sharePicUrl = '',
  remark = ''
) {
  return http.get(
    `/admin/api/shareAlbumById?id=${articleId}&shareUserId=${shareUserId}&openUserId=${openUserId}&type=${type}&packageId=${packageId}&sharePicUrl=${sharePicUrl}&remark=${remark}`
  )
}

export function getAlbumByIdApi(id: string) {
  return http.get(`/admin/api/getAlbumById?id=${id}`)
}

export function getOpenId(id: string) {
  // return http.get(`/cnbg-outer/wechat/openid/get?code=${id}`)
  return http.get(`https://cnbg.yaoyi.net/cnbg-outer/wechat/openid/get?code=${id}`)
}
