common.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import req from '../request';
  2. export default {
  3. //登录
  4. login: (data: any) => {
  5. return req({
  6. url: '/user/login',
  7. method: 'post',
  8. data: data,
  9. headers: {
  10. auth: false //不要鉴权
  11. }
  12. });
  13. },
  14. //退出
  15. logout: (data: any) => {
  16. return req({
  17. url: '/user/logout',
  18. method: 'get',
  19. data: data
  20. });
  21. },
  22. //获取登录信息
  23. getUserInfo: (data: any) => {
  24. return req({
  25. url: '/user/userinfo',
  26. method: 'get',
  27. data: data
  28. });
  29. },
  30. //获取班级列表
  31. classList: (data: any) => {
  32. return req({
  33. url: '/school/classes_list',
  34. method: 'get',
  35. data: data
  36. });
  37. },
  38. //获取学生列表
  39. studentList: (data: any) => {
  40. return req({
  41. url: '/user/student_list',
  42. method: 'get',
  43. data: data
  44. });
  45. },
  46. //获取百度语音token
  47. baiduToken: (data: any) => {
  48. return req({
  49. url: '/bdapi_token',
  50. method: 'get',
  51. data: data
  52. });
  53. },
  54. //获取测试数据列表
  55. reportList: (data: any) => {
  56. return req({
  57. url: '/report/index',
  58. method: 'get',
  59. data: data
  60. });
  61. },
  62. //获取测试数据明细
  63. reportDetails: (data: any) => {
  64. return req({
  65. url: '/exam/search',
  66. method: 'get',
  67. data: data
  68. });
  69. },
  70. //获取工作站列表
  71. allExams: (data: any) => {
  72. return req({
  73. url: '/school/get_all_exams',
  74. method: 'post',
  75. data: data
  76. });
  77. },
  78. //删除工作站
  79. delExamSettings: (data: any) => {
  80. return req({
  81. url: '/school/del_gpu_exam_setting',
  82. method: 'post',
  83. data: data
  84. });
  85. },
  86. //关闭工作站
  87. closeExamForce: (data: any) => {
  88. return req({
  89. url: '/school/close_exam_force',
  90. method: 'post',
  91. data: data
  92. });
  93. }
  94. };