标签:核心 全局 import static default http div vue method
//核心代码,需要使用vue.use全局注册,只需参照博主的封装axios
// import {apiServer} from ‘./../../common.js‘ class http { static request(url, params = {}, method = "POST", contentType = "application/x-www-form-urlencoded") { return new Promise((resolve, reject) => { uni.request({ url, //仅为示例,并非真实接口地址。 data: params, header: { ‘Content-Type‘: contentType }, method, success: (res) => { resolve(res.data.data); } }); }) } } export default http
标签:核心 全局 import static default http div vue method
原文地址:https://www.cnblogs.com/uimeigui/p/12146405.html