提交 71abcea3 编写于 作者: Q qiang

chore: build

上级 b1f3aaae
......@@ -920,6 +920,22 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = my) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
my.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const redirectTo = {};
const getProvider = initGetProvider({
......@@ -1052,6 +1068,9 @@ function handleNetworkInfo(fromRes, toRes) {
}
function handleSystemInfo(fromRes, toRes) {
addSafeAreaInsets(fromRes, toRes);
useDeviceId({
getStorageSync,
})(fromRes, toRes);
let platform = fromRes.platform ? fromRes.platform.toLowerCase() : 'devtools';
if (!~['android', 'ios'].indexOf(platform)) {
platform = 'devtools';
......
......@@ -920,8 +920,27 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = swan) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
swan.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const getSystemInfo = {
returnValue: addSafeAreaInsets,
returnValue: (fromRes, toRes) => {
addSafeAreaInsets(fromRes, toRes);
useDeviceId()(fromRes, toRes);
},
};
const getSystemInfoSync = getSystemInfo;
......
......@@ -920,8 +920,27 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = ks) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
ks.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const getSystemInfo = {
returnValue: addSafeAreaInsets,
returnValue: (fromRes, toRes) => {
addSafeAreaInsets(fromRes, toRes);
useDeviceId()(fromRes, toRes);
},
};
const getSystemInfoSync = getSystemInfo;
......
......@@ -920,8 +920,27 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = qq) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
qq.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const getSystemInfo = {
returnValue: addSafeAreaInsets,
returnValue: (fromRes, toRes) => {
addSafeAreaInsets(fromRes, toRes);
useDeviceId()(fromRes, toRes);
},
};
const getSystemInfoSync = getSystemInfo;
......
......@@ -884,8 +884,27 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = wx) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
wx.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const getSystemInfo = {
returnValue: addSafeAreaInsets,
returnValue: (fromRes, toRes) => {
addSafeAreaInsets(fromRes, toRes);
useDeviceId()(fromRes, toRes);
},
};
const getSystemInfoSync = getSystemInfo;
......
......@@ -920,8 +920,27 @@ function addSafeAreaInsets(fromRes, toRes) {
}
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId(global = qa) {
return function addDeviceId(_, toRes) {
deviceId = deviceId || global.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
qa.setStorage({
key: UUID_KEY,
data: deviceId,
});
}
toRes.deviceId = deviceId;
};
}
const getSystemInfo = {
returnValue: addSafeAreaInsets,
returnValue: (fromRes, toRes) => {
addSafeAreaInsets(fromRes, toRes);
useDeviceId()(fromRes, toRes);
},
};
const getSystemInfoSync = getSystemInfo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册