user_student.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. import request from '@/utils/request'
  2. import { praseStrEmpty } from "@/utils/ruoyi";
  3. // 查询用户列表
  4. export function listUser(query) {
  5. return request({
  6. url: '/system/user/student/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询用户详细
  12. export function getUser(userId) {
  13. return request({
  14. url: '/system/user/student/' + praseStrEmpty(userId),
  15. method: 'get'
  16. })
  17. }
  18. // 新增用户
  19. export function addUser(data) {
  20. return request({
  21. url: '/system/user/student',
  22. method: 'post',
  23. data: data
  24. })
  25. }
  26. // 修改用户
  27. export function updateUser(data) {
  28. return request({
  29. url: '/system/user/student',
  30. method: 'put',
  31. data: data
  32. })
  33. }
  34. // 删除用户
  35. export function delUser(userId) {
  36. return request({
  37. url: '/system/user/student/' + userId,
  38. method: 'delete'
  39. })
  40. }
  41. // 用户密码重置
  42. export function resetUserPwd(userId, password) {
  43. const data = {
  44. userId,
  45. password
  46. }
  47. return request({
  48. url: '/system/user/student/resetPwd',
  49. method: 'put',
  50. data: data
  51. })
  52. }
  53. // 用户状态修改
  54. export function changeUserStatus(userId, status) {
  55. const data = {
  56. userId,
  57. status
  58. }
  59. return request({
  60. url: '/system/user/student/changeStatus',
  61. method: 'put',
  62. data: data
  63. })
  64. }
  65. // 查询授权角色
  66. export function getAuthRole(userId) {
  67. return request({
  68. url: '/system/user/student/authRole/' + userId,
  69. method: 'get'
  70. })
  71. }
  72. // 查询专业列表
  73. export function getListAll() {
  74. return request({
  75. url: '/system/major/listAll',
  76. method: 'get'
  77. })
  78. }
  79. // 保存授权角色
  80. export function updateAuthRole(data) {
  81. return request({
  82. url: '/system/user/student/authRole',
  83. method: 'put',
  84. params: data
  85. })
  86. }
  87. // 启用停用学生账号
  88. export function putUserTeacher(data) {
  89. return request({
  90. url: '/system/user/student',
  91. method: 'PUT',
  92. data: data
  93. })
  94. }
  95. //学生重置密码
  96. export function putUserResetPwd(data) {
  97. return request({
  98. url: '/system/user/student/resetPwd',
  99. method: 'PUT',
  100. data: data
  101. })
  102. }
  103. //学生删除
  104. export function delUserInfo(id) {
  105. return request({
  106. url: '/system/user/student/'+ id,
  107. method: 'delete',
  108. })
  109. }
  110. //班级模糊查询
  111. export function getWorkList(query) {
  112. return request({
  113. url: '/system/class/listAll',
  114. method: 'get',
  115. params: query
  116. })
  117. }
  118. //专业模糊查询
  119. export function getMajorList(query) {
  120. return request({
  121. url: '/system/major/listAll',
  122. method: 'get',
  123. params: query
  124. })
  125. }
  126. //导师模糊查询
  127. export function getTeacherOption(data) {
  128. return request({
  129. url: '/system/user/teacher/option',
  130. method: 'post',
  131. data: data
  132. })
  133. }
  134. //学生类别/学籍状态查询字典接口
  135. export function getVague(query) {
  136. return request({
  137. url: '/system/dict/data/getVague',
  138. method: 'get',
  139. params: query
  140. })
  141. }
  142. //新增班级接口
  143. export function addSystemClass(data) {
  144. return request({
  145. url: '/system/class',
  146. method: 'post',
  147. data: data
  148. })
  149. }
  150. //新增学生接口
  151. export function addUserStudent(data) {
  152. return request({
  153. url: '/system/user/student',
  154. method: 'post',
  155. data: data
  156. })
  157. }
  158. //编辑学生接口
  159. export function putUserStudent(data) {
  160. return request({
  161. url: '/system/user/student',
  162. method: 'put',
  163. data: data
  164. })
  165. }
  166. //获取学生详情接口
  167. export function getStudentInfo(userId) {
  168. return request({
  169. url: '/system/user/student/'+userId,
  170. method: 'get',
  171. })
  172. }
  173. //批量获取学生数据
  174. export function studentBatchSelect(data) {
  175. return request({
  176. url: 'system/user/student/batchSelect/'+data,
  177. method: 'post',
  178. })
  179. }
  180. //批量修改学生卡号
  181. export function studentUpdateCardNum(data) {
  182. return request({
  183. url: '/system/user/student/updateCardNum',
  184. method: 'put',
  185. data: data
  186. })
  187. }