api.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. import axios from "axios"
  2. import generalData from "@/assets/mock/general.json"
  3. // axios({
  4. // method: 'post',
  5. // url: `${config.backendDir}visit/saveType`,
  6. // headers: {
  7. // appId: "CA02F83A5FA162B930AA2F962D202F43B0F6DE0B51AD79FEDB03FA8202BB4909330105B3B347510D87C97060C4288280D4A744E00565A4EC",
  8. // "Content-Type": "application/json",
  9. // },
  10. // data: {
  11. // moduleType,
  12. // type: 'visit',
  13. // },
  14. // })
  15. export default {
  16. // getGeneralList() {
  17. // const listKeyNameCorrected = generalData.data.map((item) => {
  18. // const ret = {
  19. // id: item.id,
  20. // name: item.name,
  21. // createDay: item.createTime,
  22. // description: item.content,
  23. // }
  24. // return ret
  25. // })
  26. // listKeyNameCorrected.sort((a, b) => {
  27. // return Date.parse(a.createDay.substring(0, 4)) - Date.parse(b.createDay.substring(0, 4))
  28. // })
  29. // return Promise.resolve(listKeyNameCorrected)
  30. // },
  31. getSiteInfo() {
  32. return axios({
  33. method: 'get',
  34. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/site/getInfo`,
  35. headers: {
  36. "Content-Type": "application/json",
  37. },
  38. }).then((res) => {
  39. return JSON.parse(res.data.data)
  40. })
  41. },
  42. getGeneralList({
  43. endTime = '',
  44. pageNum = 0,
  45. pageSize = 10000,
  46. searchKey = '',
  47. startTime = '',
  48. } = {}) {
  49. return axios({
  50. method: 'post',
  51. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/company/pageList`,
  52. headers: {
  53. "Content-Type": "application/json",
  54. },
  55. data: {
  56. endTime,
  57. pageNum,
  58. pageSize,
  59. searchKey,
  60. startTime,
  61. },
  62. }).then((res) => {
  63. return res.data.data.records
  64. })
  65. },
  66. getGeneralDetail(id) {
  67. return axios({
  68. method: 'get',
  69. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/company/detail/${id}`,
  70. headers: {
  71. "Content-Type": "application/json",
  72. },
  73. }).then((res) => {
  74. return res.data.data
  75. })
  76. },
  77. getHistoryList({
  78. pageNum = 0,
  79. pageSize = 10000,
  80. searchKey = '',
  81. stage = '',
  82. } = {}) {
  83. return axios({
  84. method: 'post',
  85. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/history/pageList`,
  86. headers: {
  87. "Content-Type": "application/json",
  88. },
  89. data: {
  90. pageNum,
  91. pageSize,
  92. searchKey,
  93. stage,
  94. },
  95. }).then((res) => {
  96. return res.data.data.records
  97. })
  98. },
  99. getHistoryDetail(id) {
  100. return axios({
  101. method: 'get',
  102. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/history/detail/${id}`,
  103. headers: {
  104. "Content-Type": "application/json",
  105. },
  106. }).then((res) => {
  107. return res.data.data
  108. })
  109. },
  110. getTreasureList({
  111. pageNum = 0,
  112. pageSize = 10000,
  113. searchKey = '',
  114. stage = '',
  115. } = {}) {
  116. return axios({
  117. method: 'post',
  118. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/pageList`,
  119. headers: {
  120. "Content-Type": "application/json",
  121. },
  122. data: {
  123. pageNum,
  124. pageSize,
  125. searchKey,
  126. stage,
  127. }
  128. }).then((res) => {
  129. return res.data.data.records
  130. })
  131. },
  132. getTreasureDetail(id) {
  133. return axios({
  134. method: 'get',
  135. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/detail/${id}`,
  136. headers: {
  137. "Content-Type": "application/json",
  138. },
  139. data: {}
  140. }).then((res) => {
  141. return res.data.data
  142. })
  143. },
  144. reportTreasureVisit(id) {
  145. return axios({
  146. method: 'get',
  147. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/goods/addVisit/${id}`,
  148. headers: {
  149. "Content-Type": "application/json",
  150. },
  151. data: {}
  152. }).then((res) => {
  153. })
  154. },
  155. getMetaverseList({
  156. endTime = "",
  157. pageNum = 0,
  158. pageSize = 10000,
  159. searchKey = "",
  160. startTime = "",
  161. } = {}) {
  162. return axios({
  163. method: 'post',
  164. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/meta/pageList`,
  165. headers: {
  166. "Content-Type": "application/json",
  167. },
  168. data: {
  169. endTime,
  170. pageNum,
  171. pageSize,
  172. searchKey,
  173. startTime,
  174. }
  175. }).then((res) => {
  176. return res.data.data.records
  177. })
  178. },
  179. // 获取元宇宙详情
  180. getG4InfoApi(id) {
  181. return axios({
  182. method: 'get',
  183. url: `${process.env.VUE_APP_API_ORIGIN}/api/show/meta/detail/${id}`,
  184. headers: {
  185. "Content-Type": "application/json",
  186. },
  187. data: {}
  188. }).then((res) => {
  189. return res.data.data
  190. })
  191. },
  192. }