| | |
| | | // please modify it according to the actual situation |
| | | config.headers['X-Token'] = getToken() |
| | | } |
| | | config.headers['link'] = store.state.settings.link |
| | | // console.log('config' ,config) |
| | | return config |
| | | }, |
| | | error => { |
| | |
| | | |
| | | // if the custom code is not 20000, it is judged as an error. |
| | | if (res.code !== 200) { |
| | | Message({ |
| | | message: res.message || 'Error', |
| | | type: 'error', |
| | | duration: 5 * 1000 |
| | | }) |
| | | console.log(res.message || 'Error') |
| | | // Message({ |
| | | // message: res.message || 'Error', |
| | | // type: 'error', |
| | | // duration: 5 * 1000 |
| | | // }) |
| | | // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; |
| | | if (res.code === 50008 || res.code === 50012 || res.code === 50014) { |
| | | // to re-login |