1234567891011121314151617181920212223 |
- import { baseURL } from "./base.js";
- export const request = (option) => {
- return new Promise((resolve, reject) => {
- console.log(baseURL + option.url);
- uni.request({
- url: baseURL + option.url,
- method: option.method,
- data: option.data,
- Headers: {
- // "Authorization":window.localStorage.getItem('token')
- },
- success: (res) => {
- console.log(res);
- resolve(res);
- },
- fail: (error) => {
- console.log(error);
- reject(error);
- },
- });
- });
- };
|