| | |
| | | axios.interceptors.request.use( |
| | | (config) => { |
| | | let token = tool.cookie.get("TOKEN"); |
| | | config.headers['Authorization'] = 'Basic c2FiZXI6c2FiZXJfc2VjcmV0' |
| | | if(token){ |
| | | config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token |
| | | } |
| | | if(!sysConfig.REQUEST_CACHE && config.method == 'get'){ |
| | | config.params = config.params || {}; |
| | | config.params['_'] = new Date().getTime(); |
| | | // config.params['_'] = new Date().getTime(); |
| | | } |
| | | Object.assign(config.headers, sysConfig.HEADERS) |
| | | return config; |
| | |
| | | axios({ |
| | | method: 'post', |
| | | url: url, |
| | | headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8','Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0'}, |
| | | headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | data: qsStringify(data), |
| | | ...config |
| | | }).then((response) => { |