26 lines
493 B
JavaScript
26 lines
493 B
JavaScript
const install = (Vue, vm) => {
|
||
// 此为自定义配置参数,具体参数见上方说明
|
||
Vue.prototype.$u.http.setConfig({
|
||
baseUrl: 'https://dmmall.sdbairui.com/api',
|
||
loadingText: '努力加载中~',
|
||
loadingTime: 800
|
||
|
||
});
|
||
|
||
// 请求拦截,配置Token等参数
|
||
Vue.prototype.$u.http.interceptor.request = (config) => {
|
||
|
||
const token = uni.getStorageSync('token');
|
||
|
||
config.header.Authorization = 'Bearer' + " " + token;
|
||
|
||
return config;
|
||
|
||
}
|
||
|
||
}
|
||
|
||
export default {
|
||
install
|
||
}
|