index.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. //我的相关:
  2. const {
  3. http
  4. } = uni.$u
  5. //测试接口
  6. export const login = (params, config = {}) => http.post('/auth/mini_program', params, config)
  7. export const getUserInfo = (params, config = {}) => http.get('/user/info', params, config)
  8. export const updateUserInfo = (params, config = {}) => http.post('/user/update', params, config)
  9. export const getTuijian = (params, config = {}) => http.get('/user/myShare', params, config)
  10. export const getChargeRecord = (params, config = {}) => http.get('/user/myOrderList', params, config)
  11. export const getConsumerRecord = (params, config = {}) => http.get('/user/myConsumeList', params, config)
  12. // export const getJingxuan = (params, config = {}) => http.get('/getHandpick', params, config)
  13. export const getJingxuan = (params, config = {}) => {
  14. let apiUrl = '/getHandpick'
  15. Object.keys(params).forEach((item, index) => {
  16. if (index == 0) {
  17. apiUrl += `?${item}=${params[item]}`
  18. } else {
  19. apiUrl += `&${item}=${params[item]}`
  20. }
  21. })
  22. console.log('处理后的apiUrl', apiUrl);
  23. return http.get(apiUrl, params, config)
  24. }
  25. export const getRoleparmas = (params, config = {}) => http.get('/user/myRoleList', params, config)
  26. export const postTask = (params, config = {}) => http.post('/ai/submitTask', params, config)
  27. // export const getGenRes = (params, config = {}) => http.get('/ai/getTaskDetail', params, config)
  28. export const getGenRes = (params, config = {}) => {
  29. let apiUrl = '/ai/getTaskDetail'
  30. Object.keys(params).forEach((item, index) => {
  31. if (index == 0) {
  32. apiUrl += `?${item}=${params[item]}`
  33. } else {
  34. apiUrl += `&${item}=${params[item]}`
  35. }
  36. })
  37. console.log('处理后的apiUrl', apiUrl);
  38. return http.get(apiUrl, params, config)
  39. }
  40. export const getbanner = (params, config = {}) => http.get('/banner', params, config)
  41. export const getyonghu = (params, config = {}) => http.get('/agreement', params, config)
  42. export const getyinsi = (params, config = {}) => http.get('/privacy', params, config)
  43. // 暂无接口--隐私协议
  44. export const getabout = (params, config = {}) => http.get('/privacy', params, config)
  45. // export const genPdf = (params, config = {}) => http.post('/ai/generate_pdf', params, config)
  46. export const genPdf = (params, config = {}) => {
  47. let apiUrl = '/ai/downloadPdf'
  48. Object.keys(params).forEach((item, index) => {
  49. if (index == 0) {
  50. apiUrl += `?${item}=${params[item]}`
  51. } else {
  52. apiUrl += `&${item}=${params[item]}`
  53. }
  54. })
  55. console.log('处理后的apiUrl', apiUrl);
  56. return http.get(apiUrl, params, config)
  57. }
  58. export const postZhaomu = (params, config = {}) => http.post('/user/applyShare', params, config)
  59. export const payConfig = (params, config = {}) => http.get('/payConfig', params, config)
  60. // 下单接口待实现
  61. export const submitOrder = (params, config = {}) => http.post('/user/recharge/create/order', params, config)
  62. export const getTeam = (params, config = {}) => http.get('/user/myTeam', params, config)
  63. export const getYongjinList = (params, config = {}) => http.get('/user/myGiveaway', params, config)
  64. export const userWithdraw = (params, config = {}) => http.post('/user/userWithdraw', params, config)
  65. export const cashList = (params, config = {}) => http.get('/user/userWithdrawList', params, config)
  66. export const getKefu = (params, config = {}) => http.get('/getServiceConfig', params, config)
  67. export const addTeam = (params, config = {}) => http.post('/user/userWithdraw', params, config)
  68. export const getCode = (params, config = {}) => http.get('/user/getUserRqCode', params, config)
  69. export const getPosterBg = (params, config = {}) => {
  70. let apiUrl = '/getConfigByKey'
  71. Object.keys(params).forEach((item, index) => {
  72. if (index == 0) {
  73. apiUrl += `?${item}=${params[item]}`
  74. } else {
  75. apiUrl += `&${item}=${params[item]}`
  76. }
  77. })
  78. console.log('处理后的apiUrl', apiUrl);
  79. return http.get(apiUrl, params, config)
  80. }