美甲小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
741 B

  1. const HTTPS = 'https://mjcms.fnuo123.net'
  2. export const http = function (param) {
  3. let { url, data, method } = param
  4. return new Promise((resolve, rejected) => {
  5. wx.request({
  6. url: `${HTTPS + url}`,
  7. data: data,
  8. method: method,
  9. success: (result) => {
  10. if (result.statusCode === 200) {
  11. resolve(result.data)
  12. return
  13. }
  14. if(result.statusCode === 500) {
  15. wx.showToast({
  16. title: `服务器错误:${result.statusCode}`,
  17. duration: 2000,
  18. icon: 'none',
  19. })
  20. }
  21. },
  22. fail: (res) => { },
  23. complete: (res) => {
  24. wx.hideLoading({
  25. success: (res) => {},
  26. })
  27. },
  28. })
  29. })
  30. }