index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. import ajax from '../utils/request.js';
  2. /**
  3. * 登录
  4. * @param {object} ori
  5. * @returns
  6. */
  7. export function login(ori) {
  8. return ajax({
  9. api: '/user/login',
  10. data: ori.data,
  11. method: 'POST',
  12. });
  13. }
  14. /**
  15. * 登出
  16. * @param {object} ori
  17. * @returns
  18. */
  19. export function loginout(ori) {
  20. return ajax({
  21. api: '/user/logout',
  22. data: ori.data,
  23. method: 'GET',
  24. headers: {
  25. Authorization: localStorage.getItem('token'),
  26. },
  27. });
  28. }
  29. /**
  30. * 查看详情
  31. * @param {object} ori
  32. * @returns
  33. */
  34. export function getDetail(ori) {
  35. return ajax({
  36. api: '/news/data/info?offset=' + ori.data.offset,
  37. method: 'GET',
  38. headers: {
  39. Authorization: localStorage.getItem('token'),
  40. },
  41. });
  42. }
  43. /**
  44. * 文案校对
  45. * @param {object} ori
  46. * @returns
  47. */
  48. export function check(ori) {
  49. return ajax({
  50. api: '/api/check',
  51. data: ori.data,
  52. method: 'POST',
  53. headers: {
  54. Authorization: localStorage.getItem('token'),
  55. },
  56. });
  57. }
  58. /**
  59. * 热门话题
  60. * @param {object} ori
  61. * @returns
  62. */
  63. export function hotRank(ori) {
  64. return ajax({
  65. api: '/news/hotRank/list',
  66. data: ori.data,
  67. method: 'GET',
  68. headers: {
  69. Authorization: localStorage.getItem('token'),
  70. },
  71. });
  72. }
  73. /**
  74. * 检索新闻接口
  75. * @param {object} ori
  76. * @returns
  77. */
  78. export function searchData(ori) {
  79. return ajax({
  80. api: '/news/data/search',
  81. data: ori.data,
  82. method: 'POST',
  83. headers: {
  84. Authorization: localStorage.getItem('token'),
  85. },
  86. });
  87. }
  88. /**
  89. * 获得新闻分类
  90. * @param {object} ori
  91. * @returns
  92. */
  93. export function getClass(ori) {
  94. return ajax({
  95. api: '/news/data/category',
  96. data: ori.data,
  97. method: 'GET',
  98. headers: {
  99. Authorization: localStorage.getItem('token'),
  100. },
  101. });
  102. }
  103. /**
  104. * h5商城接口
  105. * @param {Object} ori
  106. * @returns
  107. */
  108. // export function getH5Mall(ori) {
  109. // return ajax({
  110. // api: '/topic/tool/img/cache/oridata.json?' + Date.now(),
  111. // data: ori.data,
  112. // base: 'json',
  113. // type: 'ajax',
  114. // method: 'GET',
  115. // headers: {
  116. // Authorization: localStorage.getItem('token'),
  117. // },
  118. // });
  119. // }
  120. /**
  121. * 行政区划接口
  122. * @param {Object} ori
  123. * @returns
  124. */
  125. export function getEconomize(ori) {
  126. return ajax({
  127. api: '/news/area/list',
  128. data: ori.data,
  129. type: 'ajax',
  130. method: 'GET',
  131. headers: {
  132. Authorization: localStorage.getItem('token'),
  133. },
  134. });
  135. }
  136. /**
  137. * 获取用户
  138. * @param {Object} ori
  139. * @returns
  140. */
  141. export function getInfo(ori) {
  142. return ajax({
  143. api: '/user/info',
  144. data: ori.data,
  145. type: 'ajax',
  146. method: 'GET',
  147. headers: {
  148. Authorization: localStorage.getItem('token'),
  149. },
  150. });
  151. }
  152. /**
  153. * 报料
  154. * @param {object} ori
  155. * @returns
  156. */
  157. export function getreporting(ori) {
  158. return ajax({
  159. api: '/clue/list',
  160. data: ori.data,
  161. type: 'ajax',
  162. method: 'POST',
  163. headers: {
  164. Authorization: localStorage.getItem('token'),
  165. },
  166. });
  167. }
  168. /**
  169. * 报料删除
  170. */
  171. export function delreporting(ori) {
  172. return ajax({
  173. api: '/clue/delete',
  174. data: ori.data,
  175. type: 'ajax',
  176. method: 'GET',
  177. headers: {
  178. Authorization: localStorage.getItem('token'),
  179. },
  180. });
  181. }
  182. /**
  183. * 查看报料
  184. */
  185. export function getreportingDetail(ori) {
  186. return ajax({
  187. api: '/clue/info',
  188. data: ori.data,
  189. type: 'ajax',
  190. method: 'GET',
  191. headers: {
  192. Authorization: localStorage.getItem('token'),
  193. },
  194. });
  195. }
  196. /**
  197. * 审核报料
  198. */
  199. export function reportingShenhe(ori) {
  200. return ajax({
  201. api: '/clue/verify',
  202. data: ori.data,
  203. type: 'ajax',
  204. method: 'POST',
  205. headers: {
  206. Authorization: localStorage.getItem('token'),
  207. },
  208. });
  209. }
  210. /**
  211. * 回复报料
  212. */
  213. export function reportingReply(ori) {
  214. return ajax({
  215. api: '/clue/reply',
  216. data: ori.data,
  217. type: 'ajax',
  218. method: 'POST',
  219. headers: {
  220. Authorization: localStorage.getItem('token'),
  221. },
  222. });
  223. }
  224. /**
  225. * 获取模板列表
  226. */
  227. export function getTemplateList(ori) {
  228. return ajax({
  229. api: '/h5template/list',
  230. data: ori.data,
  231. type: 'ajax',
  232. method: 'POST',
  233. headers: {
  234. Authorization: localStorage.getItem('token'),
  235. },
  236. });
  237. }
  238. /**
  239. * 生成页面
  240. */
  241. export function createTemplateList(ori) {
  242. return ajax({
  243. api: '/h5operate/store',
  244. data: ori.data,
  245. type: 'ajax',
  246. method: 'POST',
  247. headers: {
  248. Authorization: localStorage.getItem('token'),
  249. },
  250. });
  251. }
  252. /**
  253. * 更新页面
  254. */
  255. export function updateTemplateList(ori) {
  256. return ajax({
  257. api: '/h5operate/update',
  258. data: ori.data,
  259. type: 'ajax',
  260. method: 'POST',
  261. headers: {
  262. Authorization: localStorage.getItem('token'),
  263. },
  264. });
  265. }
  266. /**
  267. * 个人页面列表
  268. */
  269. export function getPersonalList(ori) {
  270. return ajax({
  271. api: '/h5operate/list',
  272. data: ori.data,
  273. type: 'ajax',
  274. method: 'POST',
  275. headers: {
  276. Authorization: localStorage.getItem('token'),
  277. },
  278. });
  279. }
  280. /**
  281. * 删除个人列表
  282. */
  283. export function deletePersonalList(ori) {
  284. return ajax({
  285. api: '/h5operate/delete',
  286. data: ori.data,
  287. type: 'ajax',
  288. method: 'GET',
  289. headers: {
  290. Authorization: localStorage.getItem('token'),
  291. },
  292. });
  293. }
  294. /**
  295. * 获取各个平台授权账号
  296. */
  297. export function getAccountList(ori) {
  298. return ajax({
  299. api: '/new-media/list',
  300. data: ori.data,
  301. type: 'ajax',
  302. method: 'POST',
  303. headers: {
  304. Authorization: localStorage.getItem('token'),
  305. },
  306. });
  307. }
  308. /**
  309. * 获取各个平台授权账号传播数据
  310. */
  311. export function getAccountData(ori) {
  312. return ajax({
  313. api: '/new-media/agg',
  314. data: ori.data,
  315. type: 'ajax',
  316. method: 'POST',
  317. headers: {
  318. Authorization: localStorage.getItem('token'),
  319. },
  320. });
  321. }
  322. /**
  323. * 获取平台更新时间
  324. */
  325. export function getUpdateTime(ori) {
  326. return ajax({
  327. api: '/new-media/platform',
  328. data: ori.data,
  329. type: 'ajax',
  330. method: 'POST',
  331. headers: {
  332. Authorization: localStorage.getItem('token'),
  333. },
  334. });
  335. }
  336. /**
  337. * 获取组件列表
  338. */
  339. export function getComponentsList(ori) {
  340. return ajax({
  341. api: '/operate/h5Template/json/components.json?' + Date.now(),
  342. data: ori.data,
  343. type: 'ajax',
  344. base: 'json',
  345. method: 'GET',
  346. });
  347. }
  348. /**
  349. * 获取绘画风格
  350. */
  351. export function getPaintingStyle(ori) {
  352. return ajax({
  353. api: '/get/modifiers',
  354. data: ori.data,
  355. type: 'ajax',
  356. base: 'easyDiffusion',
  357. method: 'GET',
  358. });
  359. }
  360. /**
  361. * 生成绘画
  362. */
  363. export function createDraw(ori) {
  364. return ajax({
  365. noload: true,
  366. api: '/render',
  367. data: ori.data,
  368. type: 'ajax',
  369. base: 'easyDiffusion',
  370. method: 'POST',
  371. });
  372. }
  373. /**
  374. * 查询生成绘画
  375. */
  376. export function queryDraw(ori) {
  377. return ajax({
  378. noload: true,
  379. api: '/image/stream/' + ori.data,
  380. type: 'ajax',
  381. base: 'easyDiffusion',
  382. method: 'POST',
  383. });
  384. }
  385. export function ChartGpt(data) {
  386. return ajax({
  387. noLoad: true,
  388. url: 'completions',
  389. method: 'POST',
  390. urlType: 'chat',
  391. errorToast: '当前访问人数过多,请重试。',
  392. data,
  393. });
  394. }
  395. export function getFM(data) {
  396. return ajax({
  397. noLoad: true,
  398. api: '/epg/tv',
  399. method: 'GET',
  400. base: 'epg',
  401. errorToast: '当前访问人数过多,请重试。',
  402. data,
  403. });
  404. }
  405. export function getTV(data) {
  406. return ajax({
  407. noLoad: true,
  408. api: '/epg/fm',
  409. method: 'GET',
  410. base: 'epg',
  411. errorToast: '当前访问人数过多,请重试。',
  412. data,
  413. });
  414. }
  415. export function getAllEpg(channelId) {
  416. return ajax({
  417. noLoad: true,
  418. api: '/epg/all?channelId=' + channelId,
  419. method: 'GET',
  420. base: 'epg',
  421. errorToast: '当前访问人数过多,请重试。',
  422. });
  423. }
  424. export function getKeywords({ channelId, page, pageSize }) {
  425. return ajax({
  426. noLoad: true,
  427. api:
  428. '/keywords/list?channelId=' +
  429. channelId +
  430. '&page=' +
  431. page +
  432. '&pagesize=' +
  433. pageSize,
  434. method: 'GET',
  435. base: 'epg',
  436. errorToast: '当前访问人数过多,请重试。',
  437. });
  438. }
  439. export function createData(data) {
  440. return ajax({
  441. noLoad: true,
  442. api: '/keywords/disable',
  443. method: 'POST',
  444. data,
  445. base: 'epg',
  446. errorToast: '当前访问人数过多,请重试。',
  447. });
  448. }
  449. export function disableEPG(data) {
  450. return ajax({
  451. noLoad: true,
  452. api: '/epg/disable',
  453. method: 'POST',
  454. data,
  455. base: 'epg',
  456. errorToast: '当前访问人数过多,请重试。',
  457. });
  458. }
  459. export function disableKeywords(data) {
  460. return ajax({
  461. noLoad: true,
  462. api: '/keywords/update',
  463. method: 'POST',
  464. data,
  465. base: 'epg',
  466. errorToast: '当前访问人数过多,请重试。',
  467. });
  468. }
  469. /**
  470. * 修改密码
  471. * @param {object} data
  472. * @returns
  473. */
  474. export function changePwdApi(data) {
  475. return ajax({
  476. api: '/user/pwd/reset',
  477. data,
  478. method: 'POST',
  479. headers: {
  480. Authorization: localStorage.getItem('token'),
  481. },
  482. });
  483. }
  484. /**
  485. * 获取用户列表
  486. * @param {object} data
  487. * @returns
  488. */
  489. export function getUserListApi(data) {
  490. return ajax({
  491. api: '/user/list',
  492. data,
  493. method: 'POST',
  494. headers: {
  495. Authorization: localStorage.getItem('token'),
  496. },
  497. });
  498. }
  499. /**
  500. * 获取角色列表
  501. * @param {object} data
  502. * @returns
  503. */
  504. export function getRoleListApi(data) {
  505. return ajax({
  506. api: '/user/role/list',
  507. data,
  508. method: 'GET',
  509. headers: {
  510. Authorization: localStorage.getItem('token'),
  511. },
  512. });
  513. }
  514. /**
  515. * 管理员修改用户信息
  516. * @param {object} data
  517. * @returns
  518. */
  519. export function managerChangeUserApi(data) {
  520. return ajax({
  521. api: '/user/update',
  522. data,
  523. method: 'POST',
  524. headers: {
  525. Authorization: localStorage.getItem('token'),
  526. },
  527. });
  528. }
  529. /**
  530. * 管理员新增用户
  531. * @param {object} data
  532. * @returns
  533. */
  534. export function managerAddUserApi(data) {
  535. return ajax({
  536. api: '/user/store',
  537. data,
  538. method: 'POST',
  539. headers: {
  540. Authorization: localStorage.getItem('token'),
  541. },
  542. });
  543. }
  544. /**
  545. * 删除角色
  546. * @param {object} data
  547. * @returns
  548. */
  549. export function deleteUserApi(data) {
  550. return ajax({
  551. api: '/user/role/delete',
  552. data,
  553. method: 'GET',
  554. headers: {
  555. Authorization: localStorage.getItem('token'),
  556. },
  557. });
  558. }
  559. /**
  560. * 获取菜单
  561. * @param {object} data
  562. * @returns
  563. */
  564. export function getMenuApi(data) {
  565. return ajax({
  566. api: '/menus/list',
  567. data,
  568. method: 'GET',
  569. headers: {
  570. Authorization: localStorage.getItem('token'),
  571. },
  572. });
  573. }
  574. /**
  575. * 新增角色
  576. * @param {object} data
  577. * @returns
  578. */
  579. export function addRoleApi(data) {
  580. return ajax({
  581. api: '/user/role/store',
  582. data,
  583. method: 'POST',
  584. headers: {
  585. Authorization: localStorage.getItem('token'),
  586. },
  587. });
  588. }
  589. /**
  590. * 修改角色
  591. * @param {object} data
  592. * @returns
  593. */
  594. export function chagneRoleApi(data) {
  595. return ajax({
  596. api: '/user/role/update',
  597. data,
  598. method: 'POST',
  599. headers: {
  600. Authorization: localStorage.getItem('token'),
  601. },
  602. });
  603. }