udxcms 1.0.18 → 1.0.20
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/debug_store.d.ts +1 -0
- package/dist/debug_store.js +24 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +64 -9
- package/dist/store/CmsStore.d.ts +59 -20
- package/dist/store/CmsStore.js +3 -4
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -2
- package/package.json +2 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 调试文件 - 查看实际的模块结构
|
|
2
|
+
const cmsStore = require('./dist/store/index.js');
|
|
3
|
+
console.log('=== 调试 cmsStore 结构 ===');
|
|
4
|
+
console.log('cmsStore:', cmsStore);
|
|
5
|
+
console.log('cmsStore 类型:', typeof cmsStore);
|
|
6
|
+
console.log('cmsStore 键:', Object.keys(cmsStore));
|
|
7
|
+
// 检查 CmsStore
|
|
8
|
+
console.log('\n=== CmsStore 详细信息 ===');
|
|
9
|
+
console.log('CmsStore:', cmsStore.CmsStore);
|
|
10
|
+
console.log('CmsStore 类型:', typeof cmsStore.CmsStore);
|
|
11
|
+
// 检查 default 导出
|
|
12
|
+
if (cmsStore.default) {
|
|
13
|
+
console.log('\n=== default 导出 ===');
|
|
14
|
+
console.log('default:', cmsStore.default);
|
|
15
|
+
console.log('default 键:', Object.keys(cmsStore.default));
|
|
16
|
+
}
|
|
17
|
+
// 尝试访问实际的 store 模块
|
|
18
|
+
if (cmsStore.CmsStore) {
|
|
19
|
+
console.log('\n=== CmsStore 模块结构 ===');
|
|
20
|
+
console.log('CmsStore.state:', cmsStore.CmsStore.state);
|
|
21
|
+
console.log('CmsStore.mutations:', cmsStore.CmsStore.mutations);
|
|
22
|
+
console.log('CmsStore 是否有 state:', !!cmsStore.CmsStore.state);
|
|
23
|
+
console.log('CmsStore 是否有 mutations:', !!cmsStore.CmsStore.mutations);
|
|
24
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as cmsComponents from './components';
|
|
2
|
-
import * as cmsRouter from './router';
|
|
3
|
-
import * as cmsStore from './store';
|
|
4
|
-
import * as localStorageConstant from './libs/localStorageConstant';
|
|
1
|
+
import * as cmsComponents from './components/index.js';
|
|
2
|
+
import * as cmsRouter from './router/index.js';
|
|
3
|
+
import * as cmsStore from './store/index.js';
|
|
4
|
+
import * as localStorageConstant from './libs/localStorageConstant.js';
|
|
5
5
|
/**
|
|
6
6
|
* 设置事件事务中心
|
|
7
7
|
* @param {Object} events - 事件对象
|
package/dist/index.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
// @ts-nocheck
|
|
10
10
|
// 导入必要的模块
|
|
11
|
-
import * as cmsComponents from './components';
|
|
12
|
-
import * as cmsRouter from './router';
|
|
13
|
-
import * as cmsStore from './store';
|
|
14
|
-
import * as localStorageConstant from './libs/localStorageConstant';
|
|
11
|
+
import * as cmsComponents from './components/index.js';
|
|
12
|
+
import * as cmsRouter from './router/index.js';
|
|
13
|
+
import * as cmsStore from './store/index.js';
|
|
14
|
+
import * as localStorageConstant from './libs/localStorageConstant.js';
|
|
15
15
|
// 定义内部事件事务中心
|
|
16
16
|
let eventCenter = {};
|
|
17
17
|
/**
|
|
@@ -38,6 +38,14 @@ export * as api from './api';
|
|
|
38
38
|
export * from './utils';
|
|
39
39
|
export * from './api';
|
|
40
40
|
export { localStorageConstant };
|
|
41
|
+
// 添加详细的调试信息
|
|
42
|
+
console.log('=== CMS模块调试信息 ===');
|
|
43
|
+
console.log('cmsStore 原始结构:', cmsStore);
|
|
44
|
+
console.log('cmsStore 键:', Object.keys(cmsStore));
|
|
45
|
+
Object.keys(cmsStore).forEach(key => {
|
|
46
|
+
console.log(`cmsStore.${key}:`, cmsStore[key]);
|
|
47
|
+
console.log(`cmsStore.${key} 类型:`, typeof cmsStore[key]);
|
|
48
|
+
});
|
|
41
49
|
/**
|
|
42
50
|
* 初始化 UDX CMS 相关功能
|
|
43
51
|
* 此方法可用于执行 UDX CMS 的初始化逻辑
|
|
@@ -84,18 +92,65 @@ export function init({ Vue, router, store, Parent, onComponentsRegistered, onRou
|
|
|
84
92
|
}
|
|
85
93
|
if (store) {
|
|
86
94
|
console.log('注册模块:', cmsStore);
|
|
95
|
+
console.log('cmsStore 键列表:', Object.keys(cmsStore));
|
|
87
96
|
Object.keys(cmsStore).map(v => {
|
|
88
|
-
|
|
89
|
-
console.log(
|
|
97
|
+
console.log(`处理模块: ${v}`);
|
|
98
|
+
console.log(`模块内容:`, cmsStore[v]);
|
|
90
99
|
// 确保模块有正确的结构
|
|
91
100
|
const moduleConfig = cmsStore[v];
|
|
92
101
|
if (moduleConfig && typeof moduleConfig === 'object') {
|
|
93
102
|
// 检查是否是默认导出
|
|
94
103
|
const actualModule = moduleConfig.default || moduleConfig;
|
|
104
|
+
console.log(`实际模块:`, actualModule);
|
|
105
|
+
console.log(`模块结构 - state:`, !!actualModule.state, 'mutations:', !!actualModule.mutations, 'actions:', !!actualModule.actions);
|
|
95
106
|
if (actualModule.state || actualModule.mutations || actualModule.actions) {
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
107
|
+
console.log(`注册模块 ${v} 成功`);
|
|
108
|
+
// 特殊处理 CmsStore - 将其内容合并到根 store
|
|
109
|
+
if (v === 'CmsStore') {
|
|
110
|
+
console.log('将 CmsStore 合并到根 store');
|
|
111
|
+
// 1. 首先注册 state 到根级别
|
|
112
|
+
if (actualModule.state) {
|
|
113
|
+
store.registerModule(['cmsState'], {
|
|
114
|
+
state: actualModule.state,
|
|
115
|
+
namespaced: false
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// 2. 注册 mutations 到根级别
|
|
119
|
+
if (actualModule.mutations) {
|
|
120
|
+
const rootMutations = {};
|
|
121
|
+
Object.keys(actualModule.mutations).forEach(key => {
|
|
122
|
+
rootMutations[key] = function (rootState, payload) {
|
|
123
|
+
// 确保调用时传入正确的模块状态
|
|
124
|
+
const moduleState = rootState.cmsState || actualModule.state;
|
|
125
|
+
return actualModule.mutations[key](moduleState, payload);
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
// 临时注册来获取 mutations
|
|
129
|
+
store.registerModule(['__temp__'], {
|
|
130
|
+
mutations: rootMutations
|
|
131
|
+
});
|
|
132
|
+
store.unregisterModule(['__temp__']);
|
|
133
|
+
}
|
|
134
|
+
// 3. 注册 actions 到根级别
|
|
135
|
+
if (actualModule.actions) {
|
|
136
|
+
const rootActions = {};
|
|
137
|
+
Object.keys(actualModule.actions).forEach(key => {
|
|
138
|
+
rootActions[key] = function (context, payload) {
|
|
139
|
+
// 创建一个新的 context,指向模块状态
|
|
140
|
+
const moduleContext = Object.assign(Object.assign({}, context), { state: context.state.cmsState || actualModule.state, commit: context.commit, dispatch: context.dispatch, getters: context.getters, rootState: context.rootState, rootGetters: context.rootGetters });
|
|
141
|
+
return actualModule.actions[key](moduleContext, payload);
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
store.registerModule(['__temp__'], {
|
|
145
|
+
actions: rootActions
|
|
146
|
+
});
|
|
147
|
+
store.unregisterModule(['__temp__']);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// 其他模块按正常方式注册
|
|
152
|
+
store.registerModule(v, actualModule, { preserveState: true });
|
|
153
|
+
}
|
|
99
154
|
}
|
|
100
155
|
else {
|
|
101
156
|
console.warn(`模块 ${v} 结构不正确:`, actualModule);
|
package/dist/store/CmsStore.d.ts
CHANGED
|
@@ -1,21 +1,60 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
state: {
|
|
3
|
+
countryList: any[];
|
|
4
|
+
currencyList: any[];
|
|
5
|
+
commonConf: {};
|
|
6
|
+
coins: any[];
|
|
7
|
+
location: {};
|
|
8
|
+
explorerSets: {};
|
|
9
|
+
backRouteName: string;
|
|
10
|
+
exchange: {};
|
|
11
|
+
exchangeRate: string;
|
|
12
|
+
exchangeTimer: any;
|
|
13
|
+
exchangesetCurrent: string;
|
|
14
|
+
exchangeTime: number;
|
|
15
|
+
refreshExchangeTime: number;
|
|
16
|
+
apiCache: {};
|
|
17
|
+
menuChange: number;
|
|
18
|
+
menuShow: boolean;
|
|
19
|
+
backRouteParams: {};
|
|
20
|
+
routeUrl: string;
|
|
21
|
+
};
|
|
22
|
+
getters: {
|
|
23
|
+
isbridgeChainNeedChange: (state: any, getters: any, rootState: any) => (chainId: any) => boolean;
|
|
24
|
+
};
|
|
25
|
+
mutations: {
|
|
26
|
+
setMenuChange(state: any): void;
|
|
27
|
+
setMenuShow(state: any, menuShow: any): void;
|
|
28
|
+
setCountry(state: any, countryList: any): void;
|
|
29
|
+
setCommonConf(state: any, commonConf: any): void;
|
|
30
|
+
setCurrencyList(state: any, currencyList: any): void;
|
|
31
|
+
setExplorerSets(state: any, explorerSets: any): void;
|
|
32
|
+
setLocation(state: any, location: any): void;
|
|
33
|
+
setRouteUrl(state: any, routeUrl: any): void;
|
|
34
|
+
setBackRouteName(state: any, backRouteName: any): void;
|
|
35
|
+
setBackRouteParams(state: any, backRouteParams: any): void;
|
|
36
|
+
setExchange(state: any, exchangeObj: any): void;
|
|
37
|
+
setApiCache(state: any, { type, apiDoc }: {
|
|
38
|
+
type: any;
|
|
39
|
+
apiDoc: any;
|
|
40
|
+
}): void;
|
|
41
|
+
};
|
|
42
|
+
actions: {
|
|
43
|
+
getCurrencyFunc({ state, commit, dispatch }: {
|
|
44
|
+
state: any;
|
|
45
|
+
commit: any;
|
|
46
|
+
dispatch: any;
|
|
47
|
+
}, currency: any): Promise<unknown>;
|
|
48
|
+
getCurrency({ state, commit, dispatch }: {
|
|
49
|
+
state: any;
|
|
50
|
+
commit: any;
|
|
51
|
+
dispatch: any;
|
|
52
|
+
}, currency: any): Promise<unknown>;
|
|
53
|
+
getCurrencyDataByTime({ state, commit, dispatch }: {
|
|
54
|
+
state: any;
|
|
55
|
+
commit: any;
|
|
56
|
+
dispatch: any;
|
|
57
|
+
}, currency: any): void;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
21
60
|
export default _default;
|
package/dist/store/CmsStore.js
CHANGED
|
@@ -13,11 +13,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
* @Author:
|
|
14
14
|
* @Date: 2021-07-30 10:46:1
|
|
15
15
|
* @LastEditors: lewis lewis@everylink.ai
|
|
16
|
-
* @LastEditTime: 2025-09-24 20:
|
|
16
|
+
* @LastEditTime: 2025-09-24 20:51:05
|
|
17
17
|
*/
|
|
18
18
|
import { getSignleSymbolPrice } from '../api/common';
|
|
19
|
-
|
|
20
|
-
export default new Vuex.Store({
|
|
19
|
+
export default {
|
|
21
20
|
state: {
|
|
22
21
|
countryList: [],
|
|
23
22
|
currencyList: [],
|
|
@@ -197,4 +196,4 @@ export default new Vuex.Store({
|
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
},
|
|
200
|
-
}
|
|
199
|
+
};
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CmsStore } from "./CmsStore";
|
|
2
|
-
export { default as CmsStoreH5 } from "./CmsStoreH5";
|
|
1
|
+
export { default as CmsStore } from "./CmsStore.js";
|
|
2
|
+
export { default as CmsStoreH5 } from "./CmsStoreH5.js";
|
package/dist/store/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CmsStore } from './CmsStore';
|
|
2
|
-
export { default as CmsStoreH5 } from './CmsStoreH5';
|
|
1
|
+
export { default as CmsStore } from './CmsStore.js';
|
|
2
|
+
export { default as CmsStoreH5 } from './CmsStoreH5.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "udxcms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "cms submodule",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
"clipboard-copy": "^4.0.1",
|
|
21
21
|
"ethers": "^5.4.0",
|
|
22
22
|
"dayjs": "^1.11.2",
|
|
23
|
-
"bignumber.js": "^9.0.2"
|
|
24
|
-
"vue-router": "3.6.5",
|
|
25
|
-
"vuex": "3.6.2"
|
|
23
|
+
"bignumber.js": "^9.0.2"
|
|
26
24
|
}
|
|
27
25
|
}
|