//自定义函数... export default { //在此函数中添加发送通讯前的方法(参数为:通讯对象) customMethodsForExecBefore(messageObj) { //执行自定义方法... //messageObj.headers.append('Content-Type','application/json;charset=utf-8'); if (window.GLOBAL_CACHE && window.GLOBAL_CACHE.PAGEID_CACHE) { const key = "CUR-PAGE-IDS"; let pageIds = [...window.GLOBAL_CACHE.PAGEID_CACHE].join(","); messageObj.headers.append(key, pageIds); } }, //在此函数中添加通讯完成后的回调方法(参数分别为:响应体,返回的数据,通讯对象,返回的错误信息) customMethodsForCallback(response, responseData, messageObj, error) { //执行自定义方法... //return true/false;true执行通讯回调函数,false,不执行 } }