UNPKG

cg-utilities

Version:

This is a simple utility package

58 lines (57 loc) 1.29 kB
export { decryptQuery } from './utils/xxtea'; export { getServerTime, setServerTime } from './utils'; export interface Config { /** * header中的d */ d: number; /** * 加密参数 */ value: string; /** * 是否显示console */ showConsole?: boolean; /** * 请求服务器date api地址 */ dateUrl?: string; /** * 服务器时间,如果不传递,会自动获取 */ 'X-Ca-Timestamp': string; /** * murmurhash3_32_gc 的key,jy是36,p3是24 */ murmurhash_key?: number; } /** * 删除对象中的空值 * @param obj * @returns */ export declare function deleteEmptyValue(obj: any): any; /** * 设置请求头 * @param axiosConfig * @param config {d: number} * @returns {Promise<any>} * 如果不想重复获取getServerTime, 可以在外部获取后传递给setHeaders,当然也可以使用一个节流函数来使用当前函数 */ export declare function setXxetaConfig(axiosConfig: { headers: any; url: any; method: string; data: any; params: any; }, config: Config): Promise<{}>; /** * 设置接口 R 参数(随机数) * @param axiosConfig */ export declare function setAxiosUrlRval(axiosConfig: { url: any; }): { url: any; };