| | |
| | | |
| | | service.interceptors.request.use( |
| | | (config) => { |
| | | for (let key in config.data) { |
| | | if (config.data[key] == '' && config.data[key] !== 0) { |
| | | config.data[key] = null; |
| | | } |
| | | } |
| | | // for (let key in config.data) { |
| | | // if (config.data[key] == '' && config.data[key] !== 0) { |
| | | // config.data[key] = null; |
| | | // } |
| | | // } |
| | | if (Cookies.get('token')) { |
| | | (<any>config.headers).common['tk'] = `${Cookies.get('token')}`; |
| | | (<any>config.headers).common['uid'] = `${Cookies.get('uid')}`; |
| | |
| | | Session.clear(); |
| | | window.location.href = '/'; |
| | | }); |
| | | } else if (response.data.code && response.data.code === 'A0215') { |
| | | } else if (response.data.code && response.data.code === 405) { |
| | | ElMessage.error('token失效'); |
| | | // logOut; |
| | | useLoginApi() |