23 lines
584 B
JavaScript
23 lines
584 B
JavaScript
const install = (Vue, vm) => {
|
|
// 此为自定义配置参数,具体参数见上方说明
|
|
Vue.prototype.$u.http.setConfig({
|
|
baseUrl: 'https://dmmall.sdbairui.com//storeapi',
|
|
loadingText: '努力加载中~',
|
|
loadingTime: 800,
|
|
// 设置自定义头部content-type
|
|
// header: {
|
|
// "Authorization" : "122"
|
|
// }
|
|
// ......
|
|
});
|
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
|
const token = uni.getStorageSync('token');
|
|
config.header.Authorization = 'Bearer' + " " + token;
|
|
return config;
|
|
}
|
|
}
|
|
|
|
export default {
|
|
install
|
|
}
|