import { BASE_URL } from "@/config/config.js"; export const request = (url, data, method) => { return new Promise((resolve, reject) => { uni.request({ url: BASE_URL + url, method: method || 'POST', header: { token:uni.getStorageSync('token') || '' }, data: data || {}, success: (res) => { const data = res.data resolve(data) }, fail:(error)=>{ uni.showToast({ icon:'error', title:'请求错误' }) reject(error) }, }) }).catch((e) => {}); }