赞
踩
请求方法
call_fun: function (args) {
var url = app.globalData.api_url + args.name;
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: 'POST',
data: {
...args.data
},
success: resolve,
fail: reject,
})
})
},
调用
load_sync: async function () {
console.log(1);
await app.call_fun({
name: 'm=Test&a=test',
data: {
test: 'test',
test2: 'test2',
}
}).then(function (params) {
console.log(params);
});
console.log(2);
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。