import{isObject} from './util'let Promise= require('../libs/bluebird.min')let requestList ={}//api请求记录// 将当前请求的api记录起来exportfunction addRequestKey (key){ requestList[key]=true}// 将请求完成的api从记录中移除exportfunction removeRequestKey (key){delete requestList[key]}//当前请求的api是否已有记录exportfunction hitRequestKey (key){return requestList[key]}// 获取串行请求的key,方便记录exportfunction getLockRequestKey (data){if(!isObject(data)){return data } let ajaxKey ='lockRequestKey:'try{ ajaxKey += JSON.stringify(data)}catch(e){ ajaxKey += data }return ajaxKey}//根据请求的地址,请求参数组装成api请求的key,方便记录exportfunction getRequestKey (data){if(!isObject(data)){return data } let ajaxKey ='Method: '+ data.method +',Url: '+ data.url +',Data: 'try{ ajaxKey += JSON.stringify(data.data)}catch 2/4 首页 上一页 1 2 3 4 下一页 尾页