Closed hlovingness closed 8 months ago
原先是这样,对函数参数无效,表现在自定义 createAxios,添加 transform 下的 transformRequestHook 钩子等
function deepMerge<T = any>(src: any = {}, target: any = {}): T { let key: string for (key in target) { src[key] = (isObject(src[key]) && src[key] !== null) ? deepMerge(src[key], target[key]) : (src[key] = target[key]) } return src }
得改成这样
function deepMerge<T = any>(src: any = {}, target: any = {}): T { let key: string for (key in target) { src[key] = (isObject(src[key]) && src[key] !== null) && !isFunction(src[key]) ? deepMerge(src[key], target[key]) : (src[key] = target[key]) } return src }
原先是这样,对函数参数无效,表现在自定义 createAxios,添加 transform 下的 transformRequestHook 钩子等
得改成这样