12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- const BASE_URL = 'http://localhost:8088'
- import storge from'./storge.js'
- // const BASE_URL = 'http://warning6.ikeewee.com/api'
- // export const request = (options) =>{
- // return new Promise((resolve,reject) =>{
- // let request_data=options.data || {};
- // request_data.application='app';
- // // #ifdef MP-WEIXIN
- // request_data.application='weixin';
- // // #endif
- // request_data.token=storge.get('token');
- // request_data.ajax='ajax';
- // uni.request({
- // url: BASE_URL+ options.url,
- // method: options.method|| 'GET',
- // data: request_data,
- // success: (res) => {
- // if(res.data.code==-400){
- // uni.navigateTo({
- // url:'/pages/login/login.vue'
- // })
- // }
- // else if(res.data.code!==0){
- // return uni.showToast({
- // title:'获取数据失败'
- // })
- // }else{
- // resolve(res)
- // }
- // },
- // fail: (error) => {
- // uni.showToast({
- // title:'请求接口失败'
- // })
- // reject(error)
- // }
- // })
- // })
- // }
|