| | |
| | | const err = (error) => { |
| | | if (error.response) { |
| | | |
| | | |
| | | const data = error.response.data |
| | | // const token = Vue.ls.get(ACCESS_TOKEN) |
| | | if (error.response.status === 404) { |
| | |
| | | }) |
| | | } |
| | | if (error.response.status === 500) { |
| | | if (data.message == undefined) { |
| | | message.error(error.response.data) |
| | | } else { |
| | | if (data.message.length > 0) { |
| | | message.error(data.message) |
| | | } |
| | | } |
| | | } |
| | | if (error.response.status === 401 && !(data.result && data.result.isLogin)) { |
| | | notification.error({ |
| | | message: 'Unauthorized', |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | devServer: { |
| | | port: 8080, |
| | | proxy: { |
| | | '/api': { |
| | | target: process.env.VUE_APP_API_BASE_URL, |
| | | ws: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api': '' // 需要rewrite的, |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | }; |