sentry-uniapp
Version:
用于Uniapp/小程序/快应用等平台的 Sentry SDK
80 lines • 2.01 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.appName = exports.sdk = void 0;
var currentSdk = {
// tslint:disable-next-line: no-empty
request: function () {
},
// tslint:disable-next-line: no-empty
httpRequest: function () {
},
// tslint:disable-next-line: no-empty
getSystemInfoSync: function () {
},
// tslint:disable-next-line: no-empty
getSystemInfo: function () {
},
};
/**
* 获取跨平台的 SDK
*/
var getSDK = function () {
if (typeof uni === "object") {
currentSdk = uni;
}
else if (typeof wx === "object") {
currentSdk = wx;
}
else if (typeof my === "object") {
currentSdk = my;
}
else if (typeof tt === "object") {
currentSdk = tt;
}
else if (typeof dd === "object") {
currentSdk = dd;
}
else if (typeof qq === "object") {
currentSdk = qq;
}
else if (typeof swan === "object") {
currentSdk = swan;
}
else {
// tslint:disable-next-line:no-console
console.log("sentry-uniapp 暂不支持此平台, 快应用请使用 sentry-quickapp");
}
return currentSdk;
};
/**
* 获取平台名称
*/
var getAppName = function () {
var currentAppName = "unknown";
if (typeof uni === "object") {
currentAppName = "uniapp";
}
else if (typeof wx === "object") {
currentAppName = "wechat";
}
else if (typeof my === "object") {
currentAppName = "alipay";
}
else if (typeof tt === "object") {
currentAppName = "bytedance";
}
else if (typeof dd === "object") {
currentAppName = "dingtalk";
}
else if (typeof qq === "object") {
currentAppName = "qq";
}
else if (typeof swan === "object") {
currentAppName = "swan";
}
return currentAppName;
};
var sdk = getSDK();
exports.sdk = sdk;
var appName = getAppName();
exports.appName = appName;
//# sourceMappingURL=crossPlatform.js.map