yxna-api.js 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const baseUrl = "https://www.cqna.gov.cn/data/"
  2. // const baseUrl = "https://www.cqna.gov.cn/mnazw/"
  3. const request = (options) => {
  4. return new Promise((resolve, reject) => {
  5. options.url = baseUrl + options.url
  6. wx.request({
  7. // 配置 "wx.request" 请求参数
  8. ...options,
  9. header: {
  10. 'content-type': 'application/json;charset=UTF-8'
  11. },
  12. success: function (res) {
  13. // console.log("network-res=>", res);
  14. // 返回成功信息
  15. resolve(res.data)
  16. },
  17. fail: function (error) {
  18. // console.log("network-err=>", error);
  19. // 返回错误信息
  20. reject(error)
  21. }
  22. })
  23. })
  24. }
  25. export function getAlbumList(data) {
  26. return request({
  27. url: `/yxna/getAlbumList`,
  28. method: 'GET',
  29. data: data
  30. })
  31. }
  32. export function getDocumentPageFront(data) {
  33. return request({
  34. url: `yxna/getDocumentPageFront`,
  35. method: 'GET',
  36. data: data
  37. })
  38. }
  39. export {
  40. baseUrl
  41. }