udxcms 1.0.37 → 1.0.39

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.
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author:
3
3
  * @Date: 2020-11-19 12:38:02
4
- * @LastEditTime: 2025-10-30 21:49:14
4
+ * @LastEditTime: 2025-11-04 11:41:25
5
5
  * @LastEditors: lewis lewis@everylink.ai
6
6
  * @Description:
7
7
  -->
@@ -133,7 +133,7 @@
133
133
  watch: {
134
134
  currencyList: {
135
135
  handler(newVal, oldVal) {
136
- console.log('currencyList watch - new:', newVal, 'old:', oldVal)
136
+ console.log('currencyList watch - new:', newVal, 'old:', oldVal, this.store.state.storeType)
137
137
  },
138
138
  immediate: true,
139
139
  deep: true
@@ -153,8 +153,6 @@ export default {
153
153
  localStorage.removeItem('selectedWallet')
154
154
  localStorage.removeItem('selectedIcon')
155
155
  }
156
- // TODO: 需要删除下一行,业务逻辑应该移到组件之外,历史原因目前阶段临时保留。
157
- this.$store.commit("setDefaultChainId", item.chainId);
158
156
  this.chainId = item.chainId;
159
157
  this.$emit("change", this.chainId);
160
158
  }
@@ -4,7 +4,7 @@
4
4
  * @Author:
5
5
  * @Date: 2021-10-26 16:50:22
6
6
  * @LastEditors: lewis lewis@everylink.ai
7
- * @LastEditTime: 2025-10-24 11:08:09
7
+ * @LastEditTime: 2025-11-04 11:44:15
8
8
  -->
9
9
  <template>
10
10
  <div class='network-box' :style="{visibility: chainShow ? 'visible': 'hidden'}">
@@ -43,7 +43,7 @@
43
43
  },
44
44
  computed: {
45
45
  layer1NetworkList() {
46
- return this.$store.getters['coin/layer1NetworkList'];
46
+ return this.$store.getters['coin/layer1NetworkList'] || [];
47
47
  },
48
48
  networkNeedChange() {
49
49
  return this.$route.name + this.$store.state.wallet.walletChainId
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: lewis lewis@everylink.ai
3
3
  * @Date: 2025-09-17 10:50:27
4
4
  * @LastEditors: lewis lewis@everylink.ai
5
- * @LastEditTime: 2025-10-24 11:42:03
5
+ * @LastEditTime: 2025-11-04 11:40:54
6
6
  * @FilePath: /localTools/Users/apple/web-front/web-front/src/common_modules/cms-submodule/index.js
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
8
  */
@@ -14,6 +14,8 @@ import * as cmsStore from './store/index.js';
14
14
  import * as localStorageConstant from './libs/localStorageConstant.js';
15
15
  // 定义内部事件事务中心
16
16
  let eventCenter = {};
17
+ // 路由注册标记,防止重复注册
18
+ let routesRegistered = false;
17
19
  /**
18
20
  * 设置事件事务中心
19
21
  * @param {Object} events - 事件对象
@@ -79,18 +81,25 @@ export function init({ Vue, router, store, Parent, onComponentsRegistered, onRou
79
81
  // 调用外部注册回调
80
82
  onComponentsRegistered && onComponentsRegistered();
81
83
  }
82
- // 注册路由到路由实例
83
- if (router) {
84
+ // 注册路由到路由实例(防止重复注册)
85
+ if (router && !routesRegistered) {
84
86
  const routes = cmsRouter.Home || []; // 避免变量名冲突,修改变量名
87
+ console.log(`[udxCms] 开始注册 ${routes.length} 个路由`);
85
88
  routes.forEach(route => {
86
- if (route.component && (route.component === 'parentView' || route.componentName === 'parentView' || route.component === 'Parent')) {
89
+ if (route.component && (["parentView", "Parent"].includes(route.component) || route.componentName === 'parentView')) {
87
90
  route.component = Parent;
88
91
  }
89
92
  router.addRoute(route);
93
+ console.log(`[udxCms] 注册路由: ${route.name} (${route.path})`);
90
94
  });
95
+ routesRegistered = true; // 标记已注册
96
+ console.log('[udxCms] 路由注册完成');
91
97
  // 调用外部注册回调
92
98
  onRoutesRegistered && onRoutesRegistered();
93
99
  }
100
+ else if (router && routesRegistered) {
101
+ console.log('[udxCms] 路由已注册,跳过重复注册');
102
+ }
94
103
  if (store) {
95
104
  // console.log('注册模块:', cmsStore);
96
105
  // console.log('cmsStore 键列表:', Object.keys(cmsStore));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "udxcms",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "cms submodule",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",