app.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. const axios = require("@/common/axios").default;
  2. import qs from "qs";
  3. // import axios from '@/common/axios'
  4. const api = "/api-teacher";
  5. import request from "@/helpers/request";
  6. // 发送登录短信验证码
  7. const sendSmsRequest = (data) => {
  8. return request({
  9. url: "/code/sendSms",
  10. method: "post",
  11. requestType: "form",
  12. data,
  13. });
  14. };
  15. // 校验登录图形验证码
  16. const verifyLoginImage = (data) => {
  17. return request({
  18. url: "/code/verifyLoginImage",
  19. method: "post",
  20. requestType: "form",
  21. data,
  22. });
  23. };
  24. // 手机号密码方式登录
  25. const usernameLogin = (data) => {
  26. return axios({
  27. url: "/api-auth/usernameLogin",
  28. method: "post",
  29. data: qs.stringify(data),
  30. });
  31. };
  32. // 发送登录短信验证码
  33. const sendSms = (data) => {
  34. return axios({
  35. url: "/api-student/code/sendSms",
  36. method: "post",
  37. data: qs.stringify(data),
  38. });
  39. };
  40. // 短信验证码的方式登录
  41. const smsLogin = (data) => {
  42. return axios({
  43. url: "/api-auth/smsLogin",
  44. method: "post",
  45. data: qs.stringify(data),
  46. });
  47. };
  48. // 注册登录
  49. const registerAdd = (data) => {
  50. return axios({
  51. url: "/api-student/register/add",
  52. method: "post",
  53. data: qs.stringify(data),
  54. });
  55. };
  56. // 设置密码
  57. const userSetPassword = (data) => {
  58. return axios({
  59. url: "/api-auth/user/setPassword",
  60. method: "post",
  61. data: qs.stringify(data),
  62. });
  63. };
  64. // 检查手机号
  65. const queryUserByPhone = (data) => {
  66. return axios({
  67. url: "/api-auth/user/noAuth/queryUserByPhone",
  68. method: "get",
  69. params: data,
  70. });
  71. };
  72. // 获取课程组详情
  73. const getGroupDetail = (data) => {
  74. return axios({
  75. url: "/api-student/courseGroup/getGroupDetail",
  76. method: "get",
  77. params: data,
  78. });
  79. };
  80. // 购买课程组
  81. const buyCourseGroup = (data) => {
  82. return axios({
  83. url: "/api-student/courseGroup/buyCourseGroup",
  84. method: "post",
  85. data: qs.stringify(data),
  86. });
  87. };
  88. // 创建课程
  89. const createCourseGroup = (data) => {
  90. return axios({
  91. url: api + "/courseGroup/createCourseGroup",
  92. method: "post",
  93. data: data,
  94. });
  95. };
  96. const sysTenantAccountGet = (data) => {
  97. return axios({
  98. url: api + "/sysTenantAccount/get",
  99. method: "get",
  100. params: data,
  101. });
  102. };
  103. const queryTenantAccountDetail = (data) => {
  104. return axios({
  105. url: api + "/sysTenantAccount/queryTenantAccountDetail",
  106. method: "get",
  107. params: data,
  108. });
  109. };
  110. // 课时使用记录列表
  111. const teacherCourseMinutes = (data) => {
  112. return axios({
  113. url: api + "/teacherCourseSchedule/teacherCourseMinutes",
  114. method: "get",
  115. params: data,
  116. });
  117. };
  118. // 分页查询活动列表
  119. const tenantEntryActivitesList = (data) => {
  120. return axios({
  121. url: api + "/tenantEntryActivities/queryPage",
  122. method: "get",
  123. params: data,
  124. });
  125. };
  126. // 分页查询活动列表
  127. const createOrder = (data) => {
  128. return axios({
  129. url: api + "/tenantPaymentOrder/createOrder",
  130. method: "post",
  131. data: qs.stringify(data),
  132. });
  133. };
  134. // 订单号查询信息
  135. const queryByOrderNo = (data) => {
  136. return axios({
  137. url: api + "/tenantPaymentOrder/queryByOrderNo",
  138. method: "get",
  139. params: data,
  140. });
  141. };
  142. // 分页查询活动列表
  143. const queryByOrderNoAuth = (data) => {
  144. return axios({
  145. url: api + "/teacherOrder/queryByOrderNo",
  146. method: "get",
  147. params: data,
  148. });
  149. };
  150. // 帮助中心分类
  151. const helpCenterCatalogList = (data) => {
  152. return axios({
  153. url: "/api-cms/helpCenterCatalog/list",
  154. method: "get",
  155. params: data,
  156. });
  157. };
  158. // 帮助中心
  159. const helpCenterContentList = (data) => {
  160. return axios({
  161. url: "/api-cms/helpCenterContent/list",
  162. method: "get",
  163. params: data,
  164. });
  165. };
  166. // 获取用户基本信息
  167. const queryUserInfo = (data) => {
  168. return axios({
  169. url: "/api-auth/queryUserInfo",
  170. method: "get",
  171. params: data,
  172. });
  173. };
  174. // 获取用户基本信息
  175. const queryTeacherInfo = (data) => {
  176. return axios({
  177. url: api + "/teacher/queryUserInfo",
  178. method: "get",
  179. params: data,
  180. });
  181. };
  182. // 获取老师评价和学生评价
  183. const getStuAndTeaReview = (data) => {
  184. return axios({
  185. url: api + "/courseReview/getStuAndTeaReview",
  186. method: "get",
  187. params: data,
  188. });
  189. };
  190. // 批量添加评价
  191. const batchAdd = (data) => {
  192. return axios({
  193. url: api + "/courseReview/batchAdd",
  194. method: "post",
  195. data: data,
  196. });
  197. };
  198. // 上传文件
  199. const uploadFile = (data) => {
  200. return axios({
  201. url: "/api-web/uploadFile",
  202. method: "post",
  203. data: data,
  204. });
  205. };
  206. export {
  207. sendSmsRequest,
  208. verifyLoginImage,
  209. usernameLogin,
  210. sendSms,
  211. smsLogin,
  212. registerAdd,
  213. userSetPassword,
  214. getGroupDetail,
  215. buyCourseGroup,
  216. createCourseGroup,
  217. sysTenantAccountGet,
  218. queryTenantAccountDetail,
  219. helpCenterCatalogList,
  220. helpCenterContentList,
  221. teacherCourseMinutes,
  222. tenantEntryActivitesList,
  223. queryUserInfo,
  224. queryTeacherInfo,
  225. createOrder,
  226. queryByOrderNo,
  227. queryByOrderNoAuth,
  228. getStuAndTeaReview,
  229. batchAdd,
  230. queryUserByPhone,
  231. uploadFile,
  232. };