data.ts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. import { Request, Response } from 'express';
  2. export default {
  3. 'GET /api/data/sumdate': (req: Request, res: Response) => {
  4. res.send(
  5. {
  6. data: [
  7. { name: '昨日新增', num: 2, rate: '50%' },
  8. { name: '昨日取关', num: 1, rate: '20%' },
  9. { name: '昨日净增', num: 5, rate: '60%' },
  10. { name: '昨日活跃', num: 3, rate: '100%' },
  11. { name: '总粉丝', num: 21, rate: '30%' }
  12. ],
  13. success: true
  14. }
  15. );
  16. },
  17. 'GET /api/data/menu': (req: Request, res: Response) => {
  18. res.send(
  19. {
  20. data: [
  21. {
  22. path: '/operate',
  23. name: '运营中心',
  24. icon: 'desktop',
  25. component: './operate',
  26. roles: ['admin', 'user'],
  27. },
  28. {
  29. path: '/interact',
  30. name: '智能互动',
  31. icon: 'message',
  32. roles: ['admin', 'user'],
  33. routes: [
  34. {
  35. name: '智能推送',
  36. path: '/interact/push',
  37. component: './interact/push',
  38. roles: ['admin', 'user'],
  39. btns: {
  40. add: ['admin', 'user'],
  41. fs: ['admin', 'user'],
  42. fz: ['admin', 'user'],
  43. del: ['admin', 'user']
  44. }
  45. },
  46. {
  47. name: '关注回复',
  48. path: '/interact/reply',
  49. component: './interact/reply',
  50. roles: ['admin', 'user'],
  51. },
  52. ]
  53. },
  54. {
  55. path: '/news',
  56. name: '群发推送',
  57. icon: 'send',
  58. roles: ['admin', 'user'],
  59. routes: [
  60. {
  61. name: '客服消息',
  62. path: '/news/aservice',
  63. component: './news/aservice',
  64. roles: ['admin', 'user'],
  65. },
  66. {
  67. name: '模板消息',
  68. path: '/news/atemplate',
  69. component: './news/atemplate',
  70. roles: ['admin', 'user'],
  71. },
  72. {
  73. name: '高级群发',
  74. path: '/news/advanced',
  75. component: './news/advanced',
  76. roles: ['admin', 'user'],
  77. }
  78. ]
  79. },
  80. {
  81. path: '/fans',
  82. name: '粉丝管理',
  83. icon: 'team',
  84. roles: ['admin', 'user'],
  85. routes: [
  86. {
  87. name: '粉丝消息',
  88. path: '/fans/message',
  89. component: './fans/message',
  90. roles: ['admin', 'user'],
  91. },
  92. {
  93. name: '粉丝列表',
  94. path: '/fans/list',
  95. component: './fans/list',
  96. roles: ['admin', 'user'],
  97. },
  98. {
  99. name: '粉丝标签',
  100. path: '/fans/tag',
  101. component: './fans/tag',
  102. roles: ['admin', 'user'],
  103. }
  104. ]
  105. },
  106. {
  107. path: '/material',
  108. name: '素材管理',
  109. icon: 'database',
  110. roles: ['admin', 'user'],
  111. routes: [
  112. {
  113. name: '本地素材',
  114. path: '/material/cloud',
  115. component: './material/cloud',
  116. roles: ['admin', 'user'],
  117. },
  118. {
  119. name: '微信素材',
  120. path: '/material/weChat',
  121. component: './material/weChat',
  122. roles: ['admin', 'user'],
  123. }
  124. ],
  125. },
  126. {
  127. path: '/account',
  128. name: '公众号管理',
  129. icon: 'qrcode',
  130. component: './account',
  131. roles: ['admin', 'user'],
  132. btns: {
  133. add: ['admin', 'user'],
  134. fs: ['admin', 'user'],
  135. fz: ['admin', 'user'],
  136. del: ['admin', 'user']
  137. }
  138. },
  139. {
  140. path: '/books',
  141. name: '小说平台管理',
  142. icon: 'read',
  143. component: './books',
  144. roles: ['admin', 'user'],
  145. },
  146. ],
  147. success: true
  148. }
  149. );
  150. },
  151. 'GET /api/data/gzh': (req: Request, res: Response) => {
  152. res.send(
  153. {
  154. data: [
  155. { group_name: '昨日新增', list: [{ name: '公众号1' }, { name: '公众号2' }], sum: 2 },
  156. { group_name: '昨日取关', list: [{ name: '公众号3' }, { name: '公众号4' }], sum: 2 },
  157. { group_name: '昨日净增', list: [{ name: '公众号5' }, { name: '公众号6' }], sum: 2 },
  158. { group_name: '未定义', list: [{ name: '公众号7' }, { name: '公众号8' }], sum: 2 }
  159. ],
  160. success: true
  161. }
  162. );
  163. },
  164. 'GET /api/data/gzhsc': (req: Request, res: Response) => {
  165. let textimgArr = [{ value: '1', name: '图文标签1' }, { value: '2', name: '图文标签2' }]
  166. let audioArr = [{ value: '1', name: '音频标签1' }, { value: '2', name: '音频标签2' }]
  167. let videoArr = [{ value: '1', name: '视频标签1' }, { value: '2', name: '视频标签2' }]
  168. let imgsArr = [{ value: '1', name: '图片标签1' }, { value: '2', name: '图片标签2' }]
  169. let titlearr = ['是是是', 'wwww', '2331', '可交换机卡', '客家话加快速度', '可交换机卡']
  170. let imgArr = ['https://mmbiz-qpic-cn.weituibao.com/mmbiz_jpg/aOSRF0Qd4OHWicJyVYQQhEcrcQbDP011qnxvWVXIHwCtwfHOHYKnrJwKTYDs777vYYrtpkEK8pv2ibqpaU9Apq1w/0?wx_fmt=jpeg', 'https://mmbiz-qpic-cn.weituibao.com/mmbiz_jpg/aOSRF0Qd4OFn6Yj3QevQX4H2dg4ptuj18d1MsqN996jtXuK2ATPfjmMxiakm29EguzdGiafnfEwXD07eOtstxr2w/0?wx_fmt=jpeg']
  171. res.send(
  172. {
  173. data: {
  174. imgtext: {
  175. data: Array(30).fill('').map((item: any, index: number) => {
  176. return {
  177. date: `2020-09-${Math.floor(Math.random() * 10 + 1)}`,
  178. url: imgArr[index % 2],
  179. name: titlearr[Math.floor(Math.random() * 10)] || '测试',
  180. tag: textimgArr[index % 2]
  181. }
  182. }),
  183. tags: textimgArr
  184. },
  185. audio: {
  186. data: Array(30).fill('').map((item: any, index: number) => {
  187. return {
  188. url: 'https://www.runoob.com/try/demo_source/horse.mp3',
  189. name: titlearr[Math.floor(Math.random() * 10)] || '测试',
  190. tag: audioArr[index % 2]
  191. }
  192. }),
  193. tags: audioArr
  194. },
  195. video: {
  196. data: Array(30).fill('').map((item: any, index: number) => {
  197. return {
  198. url: 'https://www.runoob.com/try/demo_source/movie.mp4',
  199. name: titlearr[Math.floor(Math.random() * 10)] || '测试',
  200. tag: videoArr[index % 2]
  201. }
  202. }),
  203. tags: videoArr
  204. },
  205. img: {
  206. data: Array(30).fill('').map((item: any, index: number) => {
  207. return {
  208. url: imgArr[index % 2],
  209. name: titlearr[Math.floor(Math.random() * 10)] || '测试',
  210. tag: imgsArr[index % 2]
  211. }
  212. }),
  213. tags: imgsArr
  214. }
  215. },
  216. success: true
  217. }
  218. );
  219. }
  220. }