|
|
|
|
@ -22,7 +22,7 @@ const install = (Vue, vm) => {
|
|
|
|
|
|
|
|
|
|
// 请求拦截部分,如配置,每次请求前都会执行
|
|
|
|
|
Vue.prototype.$u.http.interceptor.request = (config) => {
|
|
|
|
|
console.log('config-http', config)
|
|
|
|
|
//console.log('config-http', config)
|
|
|
|
|
// 引用token
|
|
|
|
|
// 方式一,存放在vuex的token,假设使用了uView封装的vuex方式
|
|
|
|
|
// 见:https://uviewui.com/components/globalVariable.html
|
|
|
|
|
@ -38,7 +38,7 @@ const install = (Vue, vm) => {
|
|
|
|
|
|
|
|
|
|
// 响应拦截,如配置,每次请求结束都会执行本方法
|
|
|
|
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
|
|
|
|
console.log('res-http', res)
|
|
|
|
|
//console.log('res-http', res)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.statusCode === 200) {
|
|
|
|
|
|