api.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { AxiosPromise, AxiosResponse } from "axios";
  2. import request from "./request";
  3. //用户授权码模式登录
  4. function loginCode(data?: {
  5. authorizationCode: string
  6. }) {
  7. return request({
  8. url: "login/code",
  9. method: "post",
  10. data: data
  11. })
  12. }
  13. //用户授权码模式登录--测试
  14. function loginCodeTest() {
  15. return request({
  16. url: "login/code/test",
  17. method: "post",
  18. })
  19. }
  20. //查询模拟考试题库
  21. function studentQuestionInfoSelectTestQuestionInfo(params: {
  22. liceBus: string,
  23. liceCar: string,
  24. liceMoto: string,
  25. liceTruck: string,
  26. subject: number,
  27. }): AxiosPromise<selectTestQuestionInfo.response> {
  28. return request({
  29. url: "student/question/info/selectTestQuestionInfo",
  30. method: "get",
  31. params
  32. })
  33. }
  34. //查询模拟考试题库(通用)
  35. function openApiquestionInfoSelectTestQuestionInfo(params: {
  36. gs:string,
  37. subject: number,
  38. }): AxiosPromise<selectTestQuestionInfo.response> {
  39. return request({
  40. url: "https://jpcj-admin.zzxcx.net/jpcj-admin/open-api/question/info/selectTestK14QuestionInfoList",
  41. method: "get",
  42. params
  43. })
  44. }
  45. //查询用户信息
  46. function studentUserInfo(): AxiosPromise<studentUserInfo.response> {
  47. return request({
  48. url: "student/qustion/info/selectTestQuestionInfo",
  49. method: "get",
  50. })
  51. }
  52. //查询202204题库列表
  53. async function questionTwoList(params: {
  54. pageNum: number,
  55. pageSize: number,
  56. cartype: "0" | "1" | "2" | "3",
  57. kemu: number,
  58. explainJs?: string
  59. }): Promise<AxiosPromise<questionTwoList.response>> {
  60. let res: AxiosResponse<questionTwoList.response> = await request({
  61. url: "https://admin.zzxcx.net/zzjs-admin/open-api/question/two/list",
  62. method: "get",
  63. params
  64. })
  65. //
  66. return res
  67. }
  68. export default {
  69. loginCode,
  70. loginCodeTest,
  71. studentQuestionInfoSelectTestQuestionInfo,
  72. studentUserInfo,
  73. openApiquestionInfoSelectTestQuestionInfo,
  74. questionTwoList
  75. }
  76. function AxiosPromise<T>() {
  77. throw new Error("Function not implemented.");
  78. }