user.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. import http from '@/http/api.js'
  2. // 获取token
  3. const token = (tenantId, username, password, type) => {
  4. return http.request({
  5. url: '/api/blade-auth/oauth/token',
  6. method: 'POST',
  7. header: {
  8. 'Tenant-Id': tenantId
  9. },
  10. params: {
  11. tenantId,
  12. username,
  13. password,
  14. grant_type: "password",
  15. scope: "all",
  16. type
  17. }
  18. })
  19. }
  20. export const getXqgk = () => {
  21. return http.request({
  22. url: '/blade-system/user/getXqgk',
  23. method: 'get',
  24. })
  25. }
  26. const refreshToken = (refresh_token, tenantId) => {
  27. return http.request({
  28. url: '/api/blade-auth/oauth/token',
  29. method: 'post',
  30. headers: {
  31. 'Tenant-Id': tenantId
  32. },
  33. params: {
  34. tenantId,
  35. refresh_token,
  36. grant_type: "refresh_token",
  37. scope: "all",
  38. }
  39. })
  40. }
  41. // 获取用户信息
  42. export const userInfo = () => {
  43. return http.request({
  44. url: '/api/blade-system/user/getUserInfo',
  45. method: 'GET',
  46. })
  47. }
  48. // 获取用户信息
  49. export const getUser = (id) => {
  50. return http.request({
  51. url: '/api/blade-system/user/detail',
  52. method: 'GET',
  53. params: { id }
  54. })
  55. }
  56. // 获取用户信息
  57. export const wxlogin = (row) => {
  58. return http.request({
  59. url: '/api/blade-system/user/wxlogi_qs',
  60. method: 'POST',
  61. header: {
  62. // 'Content-Type': 'application/x-www-form-urlencoded'
  63. 'Content-Type': 'application/x-www-form-urlencoded'
  64. },
  65. data: row
  66. })
  67. }
  68. //blade-auth/oauth/token
  69. export const weblogin = (row) => {
  70. return http.request({
  71. url: '/api/blade-auth/oauth/token',
  72. method: 'POST',
  73. header: {
  74. // 'Content-Type': 'application/x-www-form-urlencoded'
  75. 'Content-Type': 'application/x-www-form-urlencoded'
  76. },
  77. data: row
  78. })
  79. }
  80. // 获取帐户信息
  81. export const getzhxx = (yhbh) => {
  82. return http.request({
  83. url: '/api/miaos/zhxx/detail',
  84. method: 'GET',
  85. params: { yhbh }
  86. })
  87. }
  88. //blade-system/user/registerUser
  89. // 用户注册
  90. export const registerUser = (row) => {
  91. return wx.cloud.callContainer({
  92. "path": "/blade-system/user/registerUser_qs",
  93. "header": {
  94. "X-WX-SERVICE": "msserver",
  95. 'Content-Type': 'application/x-www-form-urlencoded'
  96. },
  97. "method": "POST",
  98. "data":row
  99. })
  100. // return http.request({
  101. // url: '/api/blade-system/user/registerUser_qs',
  102. // method: 'POST',
  103. // header: {
  104. // // 'Content-Type': 'application/x-www-form-urlencoded'
  105. // 'Content-Type': 'application/x-www-form-urlencoded'
  106. // },
  107. // data: row
  108. // })
  109. }
  110. // 用户手机号码
  111. export const getPhoneNumbers = (row) => {
  112. return http.request({
  113. url: '/api/blade-system/user/getPhoneNumber_qs',
  114. method: 'POST',
  115. header: {
  116. // 'Content-Type': 'application/x-www-form-urlencoded'
  117. 'Content-Type': 'application/x-www-form-urlencoded'
  118. },
  119. data: row
  120. })
  121. }
  122. export const updateinfo = (row) => {
  123. return http.request({
  124. url: '/api/blade-system/user/update-info',
  125. method: 'POST',
  126. data: row
  127. })
  128. }
  129. //个人信息
  130. export const updateinfos = (row) => {
  131. return http.request({
  132. url: '/api/blade-system/user/update',
  133. method: 'POST',
  134. data: row
  135. })
  136. }
  137. // 部门
  138. //1、学校列表
  139. export const university_list = () => {
  140. return wx.cloud.callContainer({
  141. "path": "/blade-system/dept/university-list",
  142. "header": {
  143. "X-WX-SERVICE": "msserver"
  144. },
  145. "method": "GET",
  146. "data":{}
  147. })
  148. // return http.request({
  149. // url: '/api/blade-system/dept/university-list',
  150. // method: 'GET'
  151. // })
  152. }
  153. export const college_list = (deptId) => {
  154. return wx.cloud.callContainer({
  155. "path": "/blade-system/dept/college-list",
  156. "header": {
  157. "X-WX-SERVICE": "msserver"
  158. },
  159. "method": "GET",
  160. "data":{deptId}
  161. })
  162. // return http.request({
  163. // url: '/api/blade-system/dept/college-list',
  164. // method: 'GET',
  165. // params:{
  166. // deptId
  167. // }
  168. // })
  169. }
  170. export const specialty_list = (deptId) => {
  171. return wx.cloud.callContainer({
  172. "path": "/blade-system/dept/specialty-list",
  173. "header": {
  174. "X-WX-SERVICE": "msserver"
  175. },
  176. "method": "GET",
  177. "data":{deptId}
  178. })
  179. // return http.request({
  180. // url: '/api/blade-system/dept/specialty-list',
  181. // method: 'GET',
  182. // params:{
  183. // deptId
  184. // }
  185. // })
  186. }
  187. export const grade_list = (deptId) => {
  188. return wx.cloud.callContainer({
  189. "path": "/blade-system/dept/grade-list",
  190. "header": {
  191. "X-WX-SERVICE": "msserver"
  192. },
  193. "method": "GET",
  194. "data":{deptId}
  195. })
  196. // return http.request({
  197. // url: '/api/blade-system/dept/grade-list',
  198. // method: 'GET',
  199. // params:{
  200. // deptId
  201. // }
  202. // })
  203. }
  204. export default {
  205. token,
  206. wxlogin,
  207. userInfo,
  208. updateinfos,
  209. refreshToken
  210. }