servers.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* eslint-disable import/prefer-default-export */
  2. import HTTPREQUEST from "./http"
  3. import Taro from "@tarojs/taro";
  4. //登录
  5. export const login = (res) => {
  6. return new Promise(async (resolve,reject)=>{
  7. Taro.showLoading({
  8. title:'登录中...',
  9. })
  10. try{
  11. let msg = await HTTPREQUEST.post('/managesignin', {
  12. mobile:res.username,
  13. password:res.password,
  14. remeber: false
  15. });
  16. if(msg.error.length === 0){
  17. Taro.setStorageSync('token', msg.token);
  18. Taro.setStorageSync('userInfor', msg.data);
  19. Taro.hideLoading();
  20. Taro.showToast({title:'登录成功',icon:'success'})
  21. resolve(msg);
  22. }else{
  23. Taro.hideLoading();
  24. Taro.showToast({title:msg.error[0].message,icon:'none'})
  25. reject();
  26. }
  27. }catch (err) {
  28. Taro.showToast({title:'系统错误,请稍后重试',icon:'none'});
  29. Taro.hideLoading();
  30. reject();
  31. console.log(err,'login')
  32. }
  33. })
  34. }
  35. // 查询客户订单
  36. export const getOrderByUid = (postData = {}) => {
  37. return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
  38. }
  39. export const getUserByName = (postData = {}) => {
  40. return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
  41. }
  42. export const addPublicRelease = (postData = {}) => {
  43. return HTTPREQUEST.post('/api/admin/release/addPublicRelease', postData)
  44. }
  45. export const setOpenId = (postData = {}) => {
  46. return HTTPREQUEST.post('/api/admin/setOpenId', postData)
  47. }
  48. export const getPublicReleaseList = (postData = {}) => {
  49. return HTTPREQUEST.get('/api/admin/release/listPublicRelease', postData)
  50. }
  51. export const publicReleaseClockIn = (postData = {}) => {
  52. return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
  53. }
  54. export const examinePublicRelease = (postData = {}) => {
  55. return HTTPREQUEST.post('/api/admin/release/examinePublicRelease', postData)
  56. }
  57. //获取外出公出详情
  58. export const getReleasetDails = (postData = {}) => {
  59. return HTTPREQUEST.get('/api/admin/release/dtails', postData)
  60. }
  61. //获取公出日志
  62. export const getListPublicReleaseLog = (postData = {}) => {
  63. return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
  64. }
  65. //修改公出申请
  66. export const updatePublicRelease = (postData = {}) => {
  67. return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
  68. }
  69. //外出未读
  70. export const getPublicReleaseUnread = (postData = {}) => {
  71. return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
  72. }
  73. //获取知道部门作息时间
  74. export const getWorkingHours = (postData = {}) => {
  75. return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
  76. }
  77. //获取部门作息列表
  78. export const getWorkingHoursList = (postData = {}) => {
  79. return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
  80. }
  81. //获取微信参数
  82. export const getWxConfig = (postData = {}) => {
  83. return HTTPREQUEST.get('/open/getWxConfig', postData)
  84. }
  85. //测试
  86. export const test = (postData = {}) => {
  87. return HTTPREQUEST.get('/open/getVCode', postData)
  88. }