|
-
- const HTTPS = 'https://mjcms.fnuo123.net'
-
- export const http = function (param) {
- let { url, data, method } = param
- return new Promise((resolve, rejected) => {
- wx.request({
- url: `${HTTPS + url}`,
- data: data,
- method: method,
- success: (result) => {
- if (result.statusCode === 200) {
- resolve(result.data)
- return
- }
- if(result.statusCode === 500) {
- wx.showToast({
- title: `服务器错误:${result.statusCode}`,
- duration: 2000,
- icon: 'none',
- })
- }
- },
- fail: (res) => { },
- complete: (res) => {
- wx.hideLoading({
- success: (res) => {},
- })
- },
- })
- })
- }
-
-
-
-
-
|