udxcms 1.0.20 → 1.0.22
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/components/h5Components/Top.vue +3 -4
- package/dist/index.js +61 -38
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: Sneed
|
|
3
3
|
* @Date: 2020-12-22 21:38:13
|
|
4
|
-
* @LastEditTime: 2025-09-
|
|
4
|
+
* @LastEditTime: 2025-09-24 22:48:02
|
|
5
5
|
* @LastEditors: lewis lewis@everylink.ai
|
|
6
6
|
* @Description:
|
|
7
7
|
-->
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
<script>
|
|
96
96
|
import _ from 'lodash';
|
|
97
97
|
import conf from '../../config/index'
|
|
98
|
-
import config from '@/config/index'
|
|
99
98
|
import { isInIsWalletApp } from './../../utils'
|
|
100
99
|
import {unwrapJSONStr} from "../../utils/parse";
|
|
101
100
|
import themeMixin from "../../mixins/themeMixin";
|
|
@@ -125,7 +124,7 @@ export default {
|
|
|
125
124
|
// },
|
|
126
125
|
titleType: {
|
|
127
126
|
type: String,
|
|
128
|
-
default:
|
|
127
|
+
default: 'logo'
|
|
129
128
|
},
|
|
130
129
|
logoPosition: {
|
|
131
130
|
type: String,
|
|
@@ -170,7 +169,7 @@ export default {
|
|
|
170
169
|
return this.iconColor
|
|
171
170
|
},
|
|
172
171
|
logoSrc() {
|
|
173
|
-
let path =
|
|
172
|
+
let path = conf.sitePath + 'site/logo/' + window.location.hostname
|
|
174
173
|
return path
|
|
175
174
|
},
|
|
176
175
|
showMobileHeader() {
|
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-09-24
|
|
5
|
+
* @LastEditTime: 2025-09-24 22:49:10
|
|
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
|
*/
|
|
@@ -39,13 +39,13 @@ export * from './utils';
|
|
|
39
39
|
export * from './api';
|
|
40
40
|
export { localStorageConstant };
|
|
41
41
|
// 添加详细的调试信息
|
|
42
|
-
console.log('=== CMS模块调试信息 ===');
|
|
43
|
-
console.log('cmsStore 原始结构:', cmsStore);
|
|
44
|
-
console.log('cmsStore 键:', Object.keys(cmsStore));
|
|
45
|
-
Object.keys(cmsStore).forEach(key => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
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
|
+
// });
|
|
49
49
|
/**
|
|
50
50
|
* 初始化 UDX CMS 相关功能
|
|
51
51
|
* 此方法可用于执行 UDX CMS 的初始化逻辑
|
|
@@ -105,46 +105,69 @@ export function init({ Vue, router, store, Parent, onComponentsRegistered, onRou
|
|
|
105
105
|
console.log(`模块结构 - state:`, !!actualModule.state, 'mutations:', !!actualModule.mutations, 'actions:', !!actualModule.actions);
|
|
106
106
|
if (actualModule.state || actualModule.mutations || actualModule.actions) {
|
|
107
107
|
console.log(`注册模块 ${v} 成功`);
|
|
108
|
-
// 特殊处理 CmsStore -
|
|
108
|
+
// 特殊处理 CmsStore - 直接合并到根 store
|
|
109
109
|
if (v === 'CmsStore') {
|
|
110
|
-
console.log('将 CmsStore
|
|
111
|
-
// 1.
|
|
110
|
+
console.log('将 CmsStore 直接合并到根 store');
|
|
111
|
+
// 1. 直接修改根 state 来添加 cms 命名空间
|
|
112
112
|
if (actualModule.state) {
|
|
113
|
-
store.
|
|
114
|
-
state
|
|
115
|
-
|
|
113
|
+
if (!store.state.cmsstore) {
|
|
114
|
+
store.state.cmsstore = {};
|
|
115
|
+
}
|
|
116
|
+
Object.keys(actualModule.state).forEach(key => {
|
|
117
|
+
store.state.cmsstore[key] = actualModule.state[key];
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
|
-
// 2.
|
|
120
|
+
// 2. 直接修改 store._mutations 来添加根级别 mutations
|
|
119
121
|
if (actualModule.mutations) {
|
|
120
|
-
|
|
121
|
-
Object.keys(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
console.log('添加根级别 mutations:', Object.keys(actualModule.mutations));
|
|
123
|
+
console.log('当前 store._mutations:', Object.keys(store._mutations));
|
|
124
|
+
Object.keys(actualModule.mutations).forEach(mutationName => {
|
|
125
|
+
if (!store._mutations[mutationName]) {
|
|
126
|
+
store._mutations[mutationName] = [];
|
|
127
|
+
}
|
|
128
|
+
// 添加 mutation 处理器
|
|
129
|
+
store._mutations[mutationName].push(function (payload) {
|
|
130
|
+
// 获取当前模块状态
|
|
131
|
+
const moduleState = store.state.cmsstore || actualModule.state;
|
|
132
|
+
// 调用原始 mutation
|
|
133
|
+
return actualModule.mutations[mutationName](moduleState, payload);
|
|
134
|
+
});
|
|
135
|
+
console.log(`已注册 mutation: ${mutationName}`);
|
|
131
136
|
});
|
|
132
|
-
|
|
137
|
+
console.log('注册后的 store._mutations:', Object.keys(store._mutations));
|
|
133
138
|
}
|
|
134
|
-
// 3.
|
|
139
|
+
// 3. 直接修改 store._actions 来添加根级别 actions
|
|
135
140
|
if (actualModule.actions) {
|
|
136
|
-
|
|
137
|
-
Object.keys(actualModule.actions).forEach(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
console.log('添加根级别 actions:', Object.keys(actualModule.actions));
|
|
142
|
+
Object.keys(actualModule.actions).forEach(actionName => {
|
|
143
|
+
if (!store._actions[actionName]) {
|
|
144
|
+
store._actions[actionName] = [];
|
|
145
|
+
}
|
|
146
|
+
// 添加 action 处理器
|
|
147
|
+
store._actions[actionName].push(function (payload) {
|
|
148
|
+
// 创建正确的 context
|
|
149
|
+
const context = {
|
|
150
|
+
state: store.state.cmsstore || actualModule.state,
|
|
151
|
+
rootState: store.state,
|
|
152
|
+
commit: store.commit,
|
|
153
|
+
dispatch: store.dispatch,
|
|
154
|
+
getters: store.getters,
|
|
155
|
+
rootGetters: store.getters
|
|
156
|
+
};
|
|
157
|
+
// 调用原始 action
|
|
158
|
+
return actualModule.actions[actionName](context, payload);
|
|
159
|
+
});
|
|
143
160
|
});
|
|
144
|
-
|
|
145
|
-
|
|
161
|
+
}
|
|
162
|
+
// 4. 直接修改 store._wrappedGetters 来添加根级别 getters
|
|
163
|
+
if (actualModule.getters) {
|
|
164
|
+
console.log('添加根级别 getters:', Object.keys(actualModule.getters));
|
|
165
|
+
Object.keys(actualModule.getters).forEach(getterName => {
|
|
166
|
+
store._wrappedGetters[getterName] = function () {
|
|
167
|
+
const moduleState = store.state.cmsstore || actualModule.state;
|
|
168
|
+
return actualModule.getters[getterName](moduleState, store.getters, store.state, store.getters);
|
|
169
|
+
};
|
|
146
170
|
});
|
|
147
|
-
store.unregisterModule(['__temp__']);
|
|
148
171
|
}
|
|
149
172
|
}
|
|
150
173
|
else {
|