@jifenn/tbmp-net-traceid
v1.0.6
Published
获取traceid的方法
Downloads
3
Readme
traceid
获取traceid的方法
methods
export declare enum APP_FIGURE {
/**
* 淘宝小程序 - 会员中心
*/
TB_MINIAPP_MEMBER_CENTER = 1,
/**
* 淘宝小程序 - 互动中心
*/
TB_MINIAPP_INTERCATION = 2,
/**
* 淘宝小程序 - 定制互动
*/
TB_MINIAPP_CUSTOM = 3,
/**
* 京东H5 - 会员中心
*/
JD_H5_MEMBER_CENTER = 65,
/**
* 微信H5 - 会员中心
*/
WX_H5_MEMBER_CENTER = 113,
/**
* 其他未定义的,比如定制
*/
OTHER = 255
}
/**
* 获取traceId
* @param platform 平台标记,目前只支持TB,JD,WX
* @param appFigure 应用标记,每个应用应该有一个唯一的应用标记
*/
export declare function getTraceId(platform: 'TB' | 'JD' | 'WX', appFigure: APP_FIGURE): string;
usage
import getTraceId from 'traceid';
console.info(getTraceId('TB', 0x01));