统计
发布:378篇
浏览:931347次
-
封装 // 封装请求 Object.defineProperty(exports, "__esModule", { value: !0 }), exports.request = void 0; var e = function(e) { return e && e.__esModule ? e : { default: e }; }(require("./es6-promise.min")), t = exports.request = function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "GET"; return function(n, r) { ... 展开全文
-
创建promose.js文件 import Promise from './es6-promise.min'; export const request = (method = 'GET') => (url, data) => { return new Promise((resolve, reject) => { wx.request({ url, data, method, header: { 'Content-Type': 'application/json' }, success: function (res) { resolve(res.data) }, fail: function (err) { ... 展开全文