|
|
|
@ -20,12 +20,13 @@ const install = (Vue, vm) => { |
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
let that = this; |
|
|
|
// 响应拦截
|
|
|
|
Vue.prototype.$u.http.interceptor.response = res => { |
|
|
|
if(res.code == 0) { |
|
|
|
return res; |
|
|
|
} else if(res.code == -2) { |
|
|
|
this.$url('/page/login/index'); |
|
|
|
that.$url('/page/login/index'); |
|
|
|
uni.clearStorageSync('userinfo'); |
|
|
|
}else { |
|
|
|
vm.$msg(res.msg); |
|
|
|
|