@meta2d/core 1.0.89 → 1.0.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.0.89",
3
+ "version": "1.0.91",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/core.js CHANGED
@@ -13,7 +13,7 @@ import pkg from '../package.json';
13
13
  import { lockedError } from './utils/error';
14
14
  import { Scroll } from './scroll';
15
15
  import { getter } from './utils/object';
16
- import { getCookie, getMeta2dData, getToken, queryURLParams } from './utils/url';
16
+ import { d, getCookie, getMeta2dData, getToken, queryURLParams } from './utils/url';
17
17
  import { HotkeyType } from './data';
18
18
  import { Message, messageList } from './message';
19
19
  import { closeJetLinks, connectJetLinks, getSendData, sendJetLinksData } from './utils/jetLinks';
@@ -1261,15 +1261,21 @@ export class Meta2d {
1261
1261
  });
1262
1262
  });
1263
1263
  });
1264
+ if (!this.store.data.iot) {
1265
+ this.store.data.iot = {};
1266
+ }
1264
1267
  if (devices.length) {
1265
- if (!this.store.data.iot) {
1266
- this.store.data.iot = {};
1267
- }
1268
1268
  this.store.data.iot.devices = devices;
1269
1269
  }
1270
+ else {
1271
+ delete this.store.data.iot.devices;
1272
+ }
1270
1273
  if (properties.length) {
1271
1274
  this.store.data.iot.list = properties;
1272
1275
  }
1276
+ else {
1277
+ delete this.store.data.iot.list;
1278
+ }
1273
1279
  }
1274
1280
  connectSocket() {
1275
1281
  this.connectWebsocket();
@@ -2019,6 +2025,7 @@ export class Meta2d {
2019
2025
  return getAllFollowers(pen, this.store);
2020
2026
  }
2021
2027
  data() {
2028
+ this.initBinds();
2022
2029
  const data = deepClone(this.store.data);
2023
2030
  const { pens, paths } = this.store.data;
2024
2031
  data.version = pkg.version;
@@ -2515,9 +2522,10 @@ export class Meta2d {
2515
2522
  if (!options.hasOwnProperty("keepalive")) {
2516
2523
  Object.assign(options, { keepallive: 30 });
2517
2524
  }
2518
- if (!options.hasOwnProperty("clean")) {
2519
- Object.assign(options, { clean: false });
2520
- }
2525
+ // clean为false 时,clientId 是必填项
2526
+ // if(options.clientId && !options.hasOwnProperty("clean")){
2527
+ // Object.assign(options,{clean: false});
2528
+ // }
2521
2529
  if (!options.hasOwnProperty("reconnectPeriod")) {
2522
2530
  Object.assign(options, { reconnectPeriod: 0 });
2523
2531
  }
@@ -2941,8 +2949,15 @@ export class Meta2d {
2941
2949
  // }
2942
2950
  //获取动态参数
2943
2951
  getDynamicParam(key) {
2952
+ let lsValue = localStorage.getItem(key);
2953
+ if (globalThis.le5leTokenD) {
2954
+ let tokenkeys = [globalThis.le5leSSOTokenName ?? 'ssotoken', globalThis.le5leTokenName ?? 'token'];
2955
+ if (tokenkeys.includes(key)) {
2956
+ lsValue = d(lsValue);
2957
+ }
2958
+ }
2944
2959
  let params = queryURLParams();
2945
- let value = params[key] || localStorage[key] || getCookie(key) || globalThis[key] || '';
2960
+ let value = params[key] || lsValue || getCookie(key) || globalThis[key] || '';
2946
2961
  return value;
2947
2962
  }
2948
2963
  onNetworkConnect(https) {