http.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import request from './request'
  2. import storage from './storage'
  3. //获取code
  4. export function wxgetCode(params) {
  5. return new Promise((resolve, reject) => {
  6. request.post("/user/session",params).then(result=>{
  7. resolve(result)
  8. }).catch(err=>{
  9. reject(err)
  10. });
  11. })
  12. }
  13. //登录
  14. export function wxLogin(params) {
  15. return new Promise((resolve, reject) => {
  16. request.post("/mini/login",params).then(result=>{
  17. resolve(result)
  18. }).catch(err=>{
  19. reject(err)
  20. });
  21. })
  22. }
  23. //登录用户协议
  24. export function getAgreement(){
  25. return request.get("/system/config/configKey/sys.login.userAgreement")
  26. }
  27. //用户信息
  28. export function getInfoData(){
  29. return request.get("/getInfo")
  30. }
  31. //首页-运维工单
  32. export function getOpsOrderOverview(stationCode){
  33. return request.get("/mini/order/home/opsOrderOverview?stationCode=" + stationCode)
  34. }
  35. //首页-换电站供应商
  36. export function getStationOverview(){
  37. return request.get("/mini/station/home/stationOverview")
  38. }
  39. //下拉框-获取权限内全部站点
  40. export function getHasStationCodeAndName(){
  41. return request.get("/mini/station/hasStationCodeAndName")
  42. }
  43. //获取供货商列表
  44. export function getSupplierList(params){
  45. return request.post("/mini/supplier/list",params)
  46. }
  47. //获取站点权限内用户下拉框
  48. export function getUserListByStationCode(stationCode){
  49. return request.get("/system/user/getUserListByStationCode?stationCode=" + stationCode)
  50. }
  51. //工单上报
  52. export function addOrder(params){
  53. return request.post("/mini/order/add",params)
  54. }
  55. //工单上报记录
  56. export function getOrderLogList(params){
  57. return request.post("/mini/workOrderLog/table/list",params)
  58. }
  59. //获取运维工单
  60. export function getOrderList(params){
  61. return request.post("/mini/order/table/list",params)
  62. }
  63. //工单详情
  64. export function getOrderDetail(id){
  65. return request.get("/mini/order/detail/getInfo/" + id)
  66. }
  67. //工单处理
  68. export function orderDeal(params){
  69. return request.post("/mini/workOrderLog/add", params)
  70. }
  71. //获取工单处理过程列表
  72. export function getOrderDealList(params){
  73. return request.post("/mini/workOrderLog/getList", params)
  74. }
  75. //我的-我的记录
  76. export function getMyRecord(stationCode){
  77. return request.get("/mini/workOrderLog/mine/myRecord?stationCode=" + stationCode)
  78. }
  79. //查询设备类型
  80. export function getDictType(dictType){
  81. return request.get("/system/dict/data/type/" + dictType)
  82. }