@fast-china/utils 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.global.js +6 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.global.min.js +1 -1
- package/dist/index.global.min.js.map +1 -1
- package/es/identity/index.d.ts +7 -1
- package/es/identity/index.mjs +6 -4
- package/es/identity/index.mjs.map +1 -1
- package/es/storage/index.mjs.map +1 -1
- package/lib/identity/index.d.ts +7 -1
- package/lib/identity/index.js +1 -1
- package/lib/identity/index.js.map +1 -1
- package/lib/storage/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -13992,12 +13992,14 @@ var FastUtils = function(exports, vue) {
|
|
|
13992
13992
|
deviceId: ""
|
|
13993
13993
|
});
|
|
13994
13994
|
const uuidRegExp = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
13995
|
-
const makeIdentity = () => {
|
|
13996
|
-
|
|
13997
|
-
|
|
13995
|
+
const makeIdentity = (deviceID) => {
|
|
13996
|
+
deviceID ?? (deviceID = state.deviceId);
|
|
13997
|
+
if (deviceID && uuidRegExp.test(deviceID)) {
|
|
13998
|
+
Local.set(state.cacheKey, deviceID);
|
|
13999
|
+
state.deviceId = deviceID;
|
|
13998
14000
|
return state.deviceId;
|
|
13999
14001
|
}
|
|
14000
|
-
|
|
14002
|
+
deviceID = Local.get(state.cacheKey);
|
|
14001
14003
|
if (deviceID && uuidRegExp.test(deviceID)) {
|
|
14002
14004
|
state.deviceId = deviceID;
|
|
14003
14005
|
return deviceID;
|