| | |
| | | : 'bearer ' + token; |
| | | } |
| | | // 开启报文加密 |
| | | if (cryptoData) { |
| | | if (config.params) { |
| | | const data = crypto.encryptAES(JSON.stringify(config.params), crypto.aesKey); |
| | | config.params = { data }; |
| | | } |
| | | if (config.data) { |
| | | config.text = true; |
| | | config.data = crypto.encryptAES(JSON.stringify(config.data), crypto.aesKey); |
| | | } |
| | | } |
| | | // if (cryptoData) { |
| | | // if (config.params) { |
| | | // const data = crypto.encryptAES(JSON.stringify(config.params), crypto.aesKey); |
| | | // config.params = { data }; |
| | | // } |
| | | // if (config.data) { |
| | | // config.text = true; |
| | | // config.data = crypto.encryptAES(JSON.stringify(config.data), crypto.aesKey); |
| | | // } |
| | | // } |
| | | //headers中配置text请求 |
| | | if (config.text === true) { |
| | | config.headers['Content-Type'] = 'text/plain'; |