qj-common 4.2.1 → 4.2.2
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 +1 -1
- package/src/permission.js +57 -31
package/package.json
CHANGED
package/src/permission.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import main from '#/main';
|
|
3
3
|
|
|
4
4
|
// White List
|
|
5
|
-
const whiteList = [`b2b.heidelbergchina.com
|
|
5
|
+
const whiteList = [`b2b.heidelbergchina.com`, `uatb2b.heidelbergchina.com`];
|
|
6
6
|
|
|
7
7
|
// Executor
|
|
8
8
|
main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgress, PageNotFound, domCreate, interceptor, queryParams, getActiveMenu, generateRoutesFromMenu }) => {
|
|
@@ -30,7 +30,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Dispatch GetAppInfo
|
|
33
|
-
store.dispatch('GetAppInfo').then(res => {
|
|
33
|
+
store.dispatch('GetAppInfo').then((res) => {
|
|
34
34
|
// Get App Path
|
|
35
35
|
const appPath = process.env.APP_PATH;
|
|
36
36
|
|
|
@@ -46,7 +46,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
46
46
|
if (menuList) {
|
|
47
47
|
// Current Routes
|
|
48
48
|
if (menuList.routerMap[appPath]) {
|
|
49
|
-
return menuList.routerMap[appPath].forEach(el => {
|
|
49
|
+
return menuList.routerMap[appPath].forEach((el) => {
|
|
50
50
|
handleRouter(el.children);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -56,10 +56,10 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// No Storage
|
|
59
|
-
store.dispatch('GetAppRouter').then(menuList => {
|
|
59
|
+
store.dispatch('GetAppRouter').then((menuList) => {
|
|
60
60
|
// Current Routes
|
|
61
61
|
if (menuList.routerMap[appPath]) {
|
|
62
|
-
return menuList.routerMap[appPath].forEach(el => {
|
|
62
|
+
return menuList.routerMap[appPath].forEach((el) => {
|
|
63
63
|
handleRouter(el.children);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -87,7 +87,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
87
87
|
const menu = {};
|
|
88
88
|
|
|
89
89
|
// Set Menu
|
|
90
|
-
menuList && menuList.forEach(element => (menu[element.proappModelCode] = element.children));
|
|
90
|
+
menuList && menuList.forEach((element) => (menu[element.proappModelCode] = element.children));
|
|
91
91
|
|
|
92
92
|
// Set Code
|
|
93
93
|
menuCode(menuList);
|
|
@@ -101,7 +101,7 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
data.forEach(item => {
|
|
104
|
+
data.forEach((item) => {
|
|
105
105
|
if (item.menuCode === 'P0000111') {
|
|
106
106
|
return window.sessionStorage.setItem('menuAction', item.menuAction);
|
|
107
107
|
}
|
|
@@ -153,10 +153,10 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
153
153
|
const noneLayout = [];
|
|
154
154
|
|
|
155
155
|
// Check Action by Preset
|
|
156
|
-
data.forEach(e => (menuActions.includes(e.menuAction) ? noneLayout.push(e) : dataLayout.push(e)));
|
|
156
|
+
data.forEach((e) => (menuActions.includes(e.menuAction) ? noneLayout.push(e) : dataLayout.push(e)));
|
|
157
157
|
|
|
158
158
|
// Check First for No Data
|
|
159
|
-
noneLayout.forEach(item => {
|
|
159
|
+
noneLayout.forEach((item) => {
|
|
160
160
|
// 只做一级
|
|
161
161
|
menus.push({
|
|
162
162
|
path: '/' + item.menuAction,
|
|
@@ -228,30 +228,56 @@ main(({ menuActions }, { proApp, router, store, _import, _import_common, NProgre
|
|
|
228
228
|
if (!proappEnvLayout) {
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const link = document.getElementsByTagName('link')[1];
|
|
234
|
-
|
|
231
|
+
let arr = document.getElementsByTagName('link') || [];
|
|
232
|
+
let link, head;
|
|
235
233
|
// Get Head
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const keywords = domCreate('meta', {
|
|
244
|
-
name: 'keywords',
|
|
245
|
-
content: proappEnvLayout.proappEnvDes,
|
|
246
|
-
});
|
|
234
|
+
if (Array.isArray(arr)) {
|
|
235
|
+
head = document.getElementsByTagName('head')[0];
|
|
236
|
+
// Extension Metas
|
|
237
|
+
const keywords = domCreate('meta', {
|
|
238
|
+
name: 'keywords',
|
|
239
|
+
content: proappEnvLayout.proappEnvDes,
|
|
240
|
+
});
|
|
247
241
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
242
|
+
const description = domCreate('meta', {
|
|
243
|
+
name: 'description',
|
|
244
|
+
content: proappEnvLayout.proappEnvDes,
|
|
245
|
+
});
|
|
252
246
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
// Insert
|
|
248
|
+
head.appendChild(keywords);
|
|
249
|
+
head.appendChild(description);
|
|
250
|
+
}
|
|
251
|
+
if (Array.isArray(arr) && arr.length > 1) {
|
|
252
|
+
// Extension Link of 1 ?
|
|
253
|
+
link = document.getElementsByTagName('link')[1];
|
|
254
|
+
// Set Href of Link
|
|
255
|
+
link.href = '';
|
|
256
|
+
link.href = proappEnvLayout.proappEnvIconUrl;
|
|
257
|
+
}
|
|
258
|
+
// // Extension Link of 1 ?
|
|
259
|
+
// const link = document.getElementsByTagName('link')[1];
|
|
260
|
+
|
|
261
|
+
// // Get Head
|
|
262
|
+
// const head = document.getElementsByTagName('head')[0];
|
|
263
|
+
|
|
264
|
+
// // Set Href of Link
|
|
265
|
+
// link.href = '';
|
|
266
|
+
// link.href = proappEnvLayout.proappEnvIconUrl;
|
|
267
|
+
|
|
268
|
+
// // Extension Metas
|
|
269
|
+
// const keywords = domCreate('meta', {
|
|
270
|
+
// name: 'keywords',
|
|
271
|
+
// content: proappEnvLayout.proappEnvDes,
|
|
272
|
+
// });
|
|
273
|
+
|
|
274
|
+
// const description = domCreate('meta', {
|
|
275
|
+
// name: 'description',
|
|
276
|
+
// content: proappEnvLayout.proappEnvDes,
|
|
277
|
+
// });
|
|
278
|
+
|
|
279
|
+
// // Insert
|
|
280
|
+
// head.appendChild(keywords);
|
|
281
|
+
// head.appendChild(description);
|
|
256
282
|
});
|
|
257
283
|
});
|