user.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import {
  2. request
  3. } from '@/libs/request.js'
  4. export function login(data) {
  5. return request({
  6. url: '/login',
  7. method: 'post',
  8. header:{
  9. 'content-type':"application/x-www-form-urlencoded"
  10. },
  11. data
  12. })
  13. }
  14. // 获取用户基本信息
  15. export function getUserProfile() {
  16. return request({
  17. url: '/user/profile',
  18. method: 'GET'
  19. })
  20. }
  21. // 更新用户基本信息
  22. export function updateUserProfile(data) {
  23. return request({
  24. url: '/user/profile/update',
  25. method: 'PUT',
  26. data
  27. })
  28. }
  29. export function getUserInfo() {
  30. return request({
  31. url: '/user/profile'
  32. })
  33. }
  34. export function logout() {
  35. return request({
  36. url: '/logout',
  37. method: 'GET'
  38. })
  39. }
  40. export function register(data) {
  41. return request({
  42. url: '/user/register',
  43. method: 'post',
  44. data: data
  45. })
  46. }
  47. /**公用上传接口 */
  48. export function uploadFile(data) {
  49. return request({
  50. url: '/upload/file',
  51. method: "post",
  52. headers: {
  53. 'Content-Type': 'multipart/form-data'
  54. },
  55. data
  56. })
  57. }
  58. export function updatePwd(data) {
  59. return request({
  60. url: '/user/updatePassword',
  61. method: "PUT",
  62. data
  63. })
  64. }
  65. //查询用户的带岗位
  66. export function getUserList() {
  67. return request({
  68. url: '/user/select',
  69. method: 'get'
  70. })
  71. }
  72. //企业微信登录
  73. export function wxWorkLogin({userId,code}) {
  74. return request({
  75. url: `/user/updateWxUserId/${userId}/${code}`,
  76. method: 'post'
  77. })
  78. }