api.ts 2.5 KB

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