import { baseURL } from "./base.js"; // console.log(window.localStorage.getItem("token")); let token; uni.getStorage({ key: "token", success: function (res) { console.log(res); token = res.data; }, }); console.log(token); export const request = (option) => { return new Promise((resolve, reject) => { uni.request({ url: baseURL + option.url, method: option.method, data: option.data, headers: { "content-type": "application/json", Authorization: "Bearer " + "token", }, success: (res) => { resolve(res); }, fail: (error) => { reject(error); }, }); }); };