feat: card log
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { getDeviceInfo } from "@/utils/system";
|
||||
import { saveRecord, viewRecord, createShareToken } from "@/api/system";
|
||||
import {
|
||||
saveRecord,
|
||||
viewRecord,
|
||||
createShareToken,
|
||||
createTracking,
|
||||
} from "@/api/system";
|
||||
|
||||
export const generateObjectId = (
|
||||
m = Math,
|
||||
@@ -101,3 +106,10 @@ export const getShareToken = async (scene, targetId = "") => {
|
||||
});
|
||||
return shareTokenRes?.shareToken || "";
|
||||
};
|
||||
|
||||
export const trackRecord = (event) => {
|
||||
createTracking({
|
||||
...event,
|
||||
page: getCurrentPages().pop()?.route,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -39,6 +39,10 @@ export const getLeftIconLeft = () => {
|
||||
// #endif
|
||||
};
|
||||
|
||||
export function getPlatform() {
|
||||
return getPlatformProvider().replace("mp-", "");
|
||||
}
|
||||
|
||||
export function getPlatformProvider() {
|
||||
const platform = process.env.UNI_PLATFORM;
|
||||
return platform || "mp-weixin";
|
||||
@@ -55,10 +59,6 @@ export function getPlatformProvider() {
|
||||
// return typeof tt !== 'undefined' ? 'toutiao' : 'weixin';
|
||||
}
|
||||
|
||||
export function getPlatform() {
|
||||
return getPlatformProvider().replace("mp-", "");
|
||||
}
|
||||
|
||||
export function getDeviceInfo() {
|
||||
const info = uni.getSystemInfoSync();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user