安卓微信7.0.7的header传带下划线参数接收异常,7.0.6正常,怎么解决?
安卓微信7.0.7的header传下划线参数接收异常,nginx已配置underscores_in_headers on,还是无效。7.0.6正常,微信的IOS
3 回复
设置header的值
axios.interceptors.request.use( config => { // console.log(config) let chis_token = localStorage.getItem( 'chis_token' ); if (chis_token) { config.headers.common[ 'CHIS_TOKEN' ] = chis_token; } intercep(config) if (config.baseURL == URL.health_sys || config.baseURL == URL.health) { if (config.data) { config.data = Util.encrypt(config.data) } else { if (config.method == 'get' && config.params) { let str = '' for (let item in config.params) { str += item + '=' + config.params[item] + '&' } str = str.substring(0, str.length - 1) config.params = { data: Util.encrypt(str) } } } } return config; }, error => { return Promise.reject(error); } ); |
调用接口
_checkSign(param) { checkSign(param).then(res => { console.log(res) }) }, |
后台java获取
String CHIS_TOKEN = request.getHeader( "CHIS_TOKEN" ); |
当安卓微信7.0.7调用时,CHIS_TOKEN获取为空,其他版本正常,微信IOS也正常