|
@@ -17,6 +17,14 @@ service.interceptors.request.use(config => {
|
|
|
|
|
|
// 添加一个返回拦截器
|
|
|
service.interceptors.response.use(response => {
|
|
|
+ // 此处添加响应拦截
|
|
|
+ if (process.env.NODE_ENV === 'production') {
|
|
|
+ const noPermissionText = ['未登录', '需要登录']
|
|
|
+ const noPermission = noPermissionText.includes(response.data.error_msg)
|
|
|
+ if (noPermission) {
|
|
|
+ location.href = '/notin/page'
|
|
|
+ }
|
|
|
+ }
|
|
|
return response.data
|
|
|
})
|
|
|
|