美甲小程序
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.

3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
12345678910111213141516171819202122232425262728293031323334353637
  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. }