修正了错误弹窗

This commit is contained in:
2020-07-29 09:37:59 +08:00
parent 7245d83dcd
commit 96adf9e6a9
3 changed files with 11 additions and 7 deletions

View File

@@ -4,17 +4,18 @@ const install = (Vue, vm) => {
baseUrl: 'https://dmmall.sdbairui.com//storeapi',
loadingText: '努力加载中~',
loadingTime: 800,
// 设置自定义头部content-type
// header: {
// "Authorization" : "122"
// }
// ......
originalData: true,
});
Vue.prototype.$u.http.interceptor.request = (config) => {
const token = uni.getStorageSync('token');
config.header.Authorization = 'Bearer' + " " + token;
return config;
}
}
Vue.prototype.$u.http.interceptor.response = (res) => {
// todo 判断状态码
return res.data;
}
}
export default {