dataModel.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import fly from '../api/request.js'
  2. // 用户登录
  3. export function userLogin(code) {
  4. return fly.request({
  5. url: '/auth/mobile/token/social?grant_type=mobil&mobile=MINI@'+code,
  6. method: 'post',
  7. headers:{
  8. 'Authorization': 'Basic dGVzdDp0ZXN0'
  9. }
  10. })
  11. }
  12. // 获取验证码
  13. export function getSmsCode(mobile) {
  14. return fly.request({
  15. url: '/admin/mobile/'+mobile,
  16. method: 'get',
  17. headers:{
  18. 'Authorization': 'Basic dGVzdDp0ZXN0'
  19. }
  20. })
  21. }
  22. // 输入验证码获取token
  23. export function getSmsToken(mobile, code) {
  24. return fly.request({
  25. url: `/auth/mobile/token/sms?mobile=SMS@${mobile}&code=${code}&grant_type=mobile`,
  26. method: 'post',
  27. headers:{
  28. 'Authorization': 'Basic dGVzdDp0ZXN0'
  29. }
  30. })
  31. }
  32. // 输入验证码获取token
  33. export function bindOpenId(code) {
  34. return fly.request({
  35. url: `/admin/social/bind?state=MINI&code=${code}`,
  36. method: 'post'
  37. })
  38. }
  39. // 获取用户信息,判断token是否过期
  40. export function getUserInfo() {
  41. return fly.request({
  42. url: '/admin/user/info',
  43. method: 'get'
  44. })
  45. }
  46. // 获取样品单列表
  47. export function getSampleList(form) {
  48. return fly.request({
  49. url: '/inventory/sample/page',
  50. method: 'get',
  51. params: form
  52. })
  53. }
  54. // 获取样品单详情
  55. export function getSampleDetail(sdpId) {
  56. return fly.request({
  57. url: `/inventory/sample/${sdpId}`,
  58. method: 'get'
  59. })
  60. }
  61. // 获取样品单qa日志
  62. export function getSampleQaLog(sdpId) {
  63. return fly.request({
  64. url: `/inventory/sample/qalog/upload/${sdpId}`,
  65. method: 'get'
  66. })
  67. }
  68. // 修改样品单qa日志
  69. export function changeSampleQaLog(sdpId,mark) {
  70. return fly.request({
  71. url: `/inventory/sample/qalog/upload/picture?sdpId=${sdpId}&mark=${mark}`,
  72. method: 'put'
  73. })
  74. }
  75. // 添加样品单qa日志
  76. export function addSampleQaLog(sdpId,mark) {
  77. return fly.request({
  78. url: `/inventory/sample/qalog/upload/log?sdpId=${sdpId}&mark=${mark}`,
  79. method: 'post'
  80. })
  81. }
  82. // 添加qa图片
  83. export function addSamplePic(form) {
  84. return fly.request({
  85. url: `/inventory/sample/qalog/upload/picture?sdpId=${sdpId}`,
  86. method: 'post',
  87. data: form
  88. })
  89. }
  90. // 删除qa图片
  91. export function delSamplePic(sdpId, url) {
  92. return fly.request({
  93. url: `/inventory/sample/qalog/upload/picture?sdpId=${sdpId}&url=${url}`,
  94. method: 'delete'
  95. })
  96. }