jjb-cmd 2.2.1 → 2.2.3

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.
@@ -0,0 +1,210 @@
1
+ /**
2
+ * @author XiWell
3
+ * @version 2.0.1
4
+ * @description 此文件为dva/router自动化文件,无需配置路由,请勿修改!
5
+ */
6
+
7
+ import React from 'react';
8
+ import { ConfigProvider } from 'antd';
9
+ import { BrowserRouter, Route, Switch } from 'dva/router';
10
+
11
+ /**
12
+ * @description 是否匹配页面
13
+ * @param name {string}
14
+ * @return {{stat: boolean, param: null}}
15
+ */
16
+ function isParamPage (name) {
17
+ const result = {
18
+ stat: false,
19
+ param: null
20
+ };
21
+ if (/^_/.test(name)) {
22
+ const match = name.replace(/\.js$/, '').split(/_/).filter(item => !!item && item !== 'index');
23
+ result.stat = match.length !== 0;
24
+ result.param = match.join('_');
25
+ }
26
+ return result;
27
+ }
28
+
29
+ /**
30
+ * @description 首字母转小写
31
+ * @param value {string}
32
+ * @return {string}
33
+ */
34
+ function toLowerCase (value) {
35
+ return `${value[ 0 ].toLowerCase()}${value.substring(1)}`;
36
+ }
37
+
38
+ /**
39
+ * @description 获取初始路由集合
40
+ * @return {{path: string, file: string}[]}
41
+ */
42
+ function getRoutes () {
43
+ const routes = [];
44
+ const fileList = require.context('~/pages', true, /\.js$/).keys();
45
+ for (let i = 0; i < fileList.length; i++) {
46
+ const route = {};
47
+ const file = fileList[ i ];
48
+ const fileSplit = file.split(/\//);
49
+ const fileName = fileSplit[ fileSplit.length - 1 ];
50
+ const {
51
+ stat: fileState,
52
+ param: fileParam
53
+ } = isParamPage(fileName);
54
+ const filePathArray = fileSplit.slice(1, fileSplit.length - 1).map(item => {
55
+ const {
56
+ stat,
57
+ param
58
+ } = isParamPage(item);
59
+ return stat
60
+ ? `:${param}`
61
+ : item;
62
+ });
63
+ if (fileState || fileName === 'index.js') {
64
+ if (filePathArray.length) {
65
+ const path = filePathArray.map(item => toLowerCase(item)).join('/');
66
+ route.path = (`/${path}${fileState
67
+ ? `/:${fileParam}`
68
+ : ''}`);
69
+ } else {
70
+ route.path = `/${fileState
71
+ ? `:${fileParam}`
72
+ : ''}`;
73
+ }
74
+ route.file = file;
75
+ routes.push(route);
76
+ }
77
+ }
78
+ return routes.reverse();
79
+ }
80
+
81
+ /**
82
+ * @typedef {object} TreeRoutes
83
+ * @property {string} path
84
+ * @property {string} file
85
+ * @property {TreeRoutes[]} children
86
+ */
87
+
88
+ /**
89
+ * @description 优化tree
90
+ * @param tree {TreeRoutes[]}
91
+ * @return {TreeRoutes[]}
92
+ */
93
+ function optimizationTree (tree = []) {
94
+ function deep (array = []) {
95
+ const inner = [];
96
+ for (let i = 0; i < array.length; i++) {
97
+ const item = array[ i ];
98
+ const newItem = {};
99
+ newItem.children = item.children.length
100
+ ? deep(item.children)
101
+ : [];
102
+ newItem.path = item.path;
103
+ newItem.Component = require(`~/pages${item.file.replace(/^\./, '')}`).default;
104
+ inner.push(newItem);
105
+ }
106
+ return inner;
107
+ }
108
+
109
+ return deep(tree);
110
+ }
111
+
112
+ /**
113
+ * @description 将初始routes转换为tree结构
114
+ * @param routes {{path: string, file: string}[]}
115
+ * @return {TreeRoutes[]}
116
+ */
117
+ function treeRoutes (routes = []) {
118
+ const dataSource = [];
119
+ const indexItem = routes.find(item => item.path === '/');
120
+ for (let i = 0; i < routes.length; i++) {
121
+ const route = routes[ i ];
122
+ if (route.path === '/') {
123
+ continue;
124
+ }
125
+ const pathArray = route.path.split('/').slice(1);
126
+ route.parentFile = pathArray.length === 1
127
+ ? null
128
+ : routes[ i - 1 ].file;
129
+ dataSource.push(route);
130
+ }
131
+ if (indexItem) {
132
+ Object.assign(indexItem, { parentFile: null });
133
+ dataSource.push(indexItem);
134
+ }
135
+ let len;
136
+ for (let i = 0; len = dataSource.length, i < len; i++) {
137
+ const arrTemp = [];
138
+ for (let j = 0; j < dataSource.length; j++) {
139
+ if (dataSource[ i ].file === dataSource[ j ].parentFile) {
140
+ dataSource[ i ].children = arrTemp;
141
+ arrTemp.push(dataSource[ j ]);
142
+ } else {
143
+ dataSource[ i ].children = arrTemp;
144
+ }
145
+ }
146
+ }
147
+ const result = [];
148
+ for (let i = 0; i < dataSource.length; i++) {
149
+ if (dataSource[ i ].parentFile === null) {
150
+ result.push(dataSource[ i ]);
151
+ }
152
+ }
153
+ return optimizationTree(result);
154
+ }
155
+
156
+ function RenderRoute (routes = [], inProps = {}) {
157
+ return (
158
+ <Switch>
159
+ {routes.map(({
160
+ path,
161
+ children,
162
+ Component
163
+ }, index) => (
164
+ <Route
165
+ exact={path === '/'}
166
+ key={index}
167
+ path={path}
168
+ render={props => (
169
+ <Component {...props}>
170
+ {RenderRoute(children, inProps)}
171
+ </Component>
172
+ )}
173
+ />
174
+ ))}
175
+ </Switch>
176
+ );
177
+ }
178
+
179
+ /**
180
+ * @description 自动化路由组件
181
+ * @param app {object}
182
+ * @param history {history}
183
+ * @return {JSX.Element}
184
+ */
185
+ export const AutomaticRouter = ({
186
+ app,
187
+ history
188
+ }) => {
189
+ return (
190
+ <ConfigProvider locale={require('antd/lib/locale/zh_CN').default}>
191
+ <BrowserRouter basename={(process.env.app || {}).basename || ''}>
192
+ <Switch>
193
+ {(process.env.app || {}).notRouter
194
+ ? (
195
+ <Route
196
+ path="*"
197
+ component={require('~/pages').default}
198
+ />
199
+ )
200
+ : (
201
+ RenderRoute(treeRoutes(getRoutes()), {
202
+ app,
203
+ history
204
+ })
205
+ )}
206
+ </Switch>
207
+ </BrowserRouter>
208
+ </ConfigProvider>
209
+ );
210
+ };
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @author XiWell
3
+ * @version 1.0.1
4
+ * @description 此文件为dva/router自动化文件,无需配置路由,请勿修改!
5
+ */
6
+
7
+ import React from 'react';
8
+ import { ConfigProvider } from 'antd';
9
+ import { Route, Router, Switch } from 'dva/router';
10
+
11
+ /**
12
+ * @description react路由扫描器
13
+ * @param props {{app: object, history: any}}
14
+ */
15
+ function ReactRouterScanner (props) {
16
+ const paths = require.context('~/pages', true, /\.(jsx|js)$/).keys().filter(item => !item.match(/components/));
17
+ const symbolByEntry = 'Entry_index.js';
18
+ const symbolByContainer = 'Container_index.js';
19
+
20
+ /**
21
+ * @description 路由处理
22
+ * @param path {string}
23
+ * @return string
24
+ */
25
+ function routeHandle (path) {
26
+ return `/${path.replace(/\/index.js$/, '').split(/\//).map(a => {
27
+ a = a.replace(a[ 0 ], a[ 0 ].toLowerCase());
28
+ return a;
29
+ }).map(a => {
30
+ if (/^[a-zA-Z]+_[a-zA-Z]+$/.test(a)) {
31
+ return `:${a.split(/_/).join('')}`;
32
+ }
33
+ return a;
34
+ }).join('/')}`;
35
+ }
36
+
37
+ const routerMap = paths.map(path => {
38
+ const pure = path.replace(/^\.\//, '');
39
+ return {
40
+ path: pure === 'index.js'
41
+ ? '/'
42
+ : pure === symbolByContainer
43
+ ? '/container'
44
+ : path === symbolByEntry
45
+ ? '/entry'
46
+ : routeHandle(pure),
47
+ suffix: 'index.js',
48
+ component: require(`~/pages/${pure}`).default,
49
+ componentName: pure.replace(/\//g, '_')
50
+ };
51
+ });
52
+
53
+ const Main = routerMap.find(item => item.componentName === 'index.js');
54
+ const Entry = routerMap.find(item => item.componentName === symbolByEntry);
55
+ const Container = routerMap.find(item => item.componentName === symbolByContainer);
56
+ const ChildrenRoute = routerMap.filter(item => item.componentName.match(new RegExp('Container_')) && item.path !== '/container');
57
+ const ContainerComponent = Container
58
+ ? Container.component
59
+ : null;
60
+ return (
61
+ <Router history={props.history}>
62
+ <Switch location={history.location}>
63
+ {Main && (
64
+ <Route
65
+ exact
66
+ path={Main.path}
67
+ component={Main.component}
68
+ />
69
+ )}
70
+ {Entry && (
71
+ <Route
72
+ exact
73
+ path={Entry.path}
74
+ component={Entry.component}
75
+ />
76
+ )}
77
+ {Container && (
78
+ <Route
79
+ path={Container.path}
80
+ render={$props => (
81
+ <ContainerComponent {...$props}>
82
+ <Switch location={history.location}>
83
+ {ChildrenRoute.map((route, key) => (
84
+ <Route
85
+ exact
86
+ key={key}
87
+ path={route.path}
88
+ component={route.component}
89
+ />
90
+ ))}
91
+ </Switch>
92
+ </ContainerComponent>
93
+ )}
94
+ />
95
+ )}
96
+ </Switch>
97
+ </Router>
98
+ );
99
+ }
100
+
101
+ /**
102
+ * @description 自动化路由组件
103
+ * @param app {object}
104
+ * @param history {history}
105
+ * @return {JSX.Element}
106
+ */
107
+ export const AutomaticRouter = ({
108
+ app,
109
+ history
110
+ }) => {
111
+ return (
112
+ <ConfigProvider locale={require('antd/lib/locale/zh_CN').default}>
113
+ <ReactRouterScanner
114
+ app={app}
115
+ history={history}
116
+ />
117
+ </ConfigProvider>
118
+ );
119
+ };
@@ -1 +1,26 @@
1
- const a15_0xf7ea35=a15_0x2076;function a15_0x2076(_0x190569,_0x3da1b9){const _0x38b64a=a15_0x38b6();return a15_0x2076=function(_0x2076ea,_0x1eb7b9){_0x2076ea=_0x2076ea-0xdc;let _0x124b12=_0x38b64a[_0x2076ea];return _0x124b12;},a15_0x2076(_0x190569,_0x3da1b9);}(function(_0x1166fa,_0x36be24){const _0x2ecbec=a15_0x2076,_0x47f9cf=_0x1166fa();while(!![]){try{const _0x4f97aa=-parseInt(_0x2ecbec(0xdd))/0x1+parseInt(_0x2ecbec(0xed))/0x2+-parseInt(_0x2ecbec(0xe8))/0x3*(parseInt(_0x2ecbec(0xf0))/0x4)+parseInt(_0x2ecbec(0xe2))/0x5*(parseInt(_0x2ecbec(0xec))/0x6)+parseInt(_0x2ecbec(0xe7))/0x7+parseInt(_0x2ecbec(0xeb))/0x8+-parseInt(_0x2ecbec(0xdc))/0x9*(parseInt(_0x2ecbec(0xe6))/0xa);if(_0x4f97aa===_0x36be24)break;else _0x47f9cf['push'](_0x47f9cf['shift']());}catch(_0x5509b4){_0x47f9cf['push'](_0x47f9cf['shift']());}}}(a15_0x38b6,0x6bd8e));const path=require(a15_0xf7ea35(0xde)),readline=require(a15_0xf7ea35(0xe0)),{f_file_copy}=require(a15_0xf7ea35(0xe5)),fs=require('fs');module['exports']=()=>{const _0x46b7a3=a15_0xf7ea35,_0x58f3d3=path['resolve']('./');!fs[_0x46b7a3(0xef)](_0x58f3d3+_0x46b7a3(0xea))&&!fs['existsSync'](_0x58f3d3+'\x5cpublic')&&!fs[_0x46b7a3(0xef)](_0x58f3d3+_0x46b7a3(0xe1))&&!fs[_0x46b7a3(0xef)](_0x58f3d3+_0x46b7a3(0xe9))&&!fs[_0x46b7a3(0xef)](_0x58f3d3+_0x46b7a3(0xdf))?(f_file_copy(__dirname+_0x46b7a3(0xee),_0x58f3d3),console['log']('初始化完成!'),process[_0x46b7a3(0xe4)](0x0)):(console[_0x46b7a3(0xe3)]('初始化失败,文件已存在!'),process['exit'](0x0));};function a15_0x38b6(){const _0x1d63d5=['44391lUKnDl','\x5cpackage.json','\x5cjjb.script','2226632bXIzdE','3402aFPLnu','1708602ynWmfF','\x5ccli.init','existsSync','28dafpbX','45ghpxow','694778JFGcjV','path','\x5cwebstorm.config.js','readline','\x5cjjb.config.json','6260pJWXaj','log','exit','./cli.install/tools','2456110UmWPdI','4379480SqubrN'];a15_0x38b6=function(){return _0x1d63d5;};return a15_0x38b6();}
1
+ const path = require('path');
2
+ const readline = require('readline');
3
+ const { f_file_copy } = require('./cli.install/tools');
4
+ const fs = require('fs');
5
+
6
+ module.exports = () => {
7
+ /**
8
+ * 下发数据根路径
9
+ * @type {string}
10
+ */
11
+ const root_path = path.resolve('./');
12
+ if (
13
+ !fs.existsSync(`${root_path}\\jjb.script`) &&
14
+ !fs.existsSync(`${root_path}\\public`) &&
15
+ !fs.existsSync(`${root_path}\\jjb.config.json`) &&
16
+ !fs.existsSync(`${root_path}\\package.json`) &&
17
+ !fs.existsSync(`${root_path}\\webstorm.config.js`)
18
+ ) {
19
+ f_file_copy(`${__dirname}\\cli.init`, root_path);
20
+ console.log('初始化完成!');
21
+ process.exit(0);
22
+ } else {
23
+ console.log('初始化失败,文件已存在!');
24
+ process.exit(0);
25
+ }
26
+ };
@@ -1 +1,206 @@
1
- const a16_0x454360=a16_0x5076;(function(_0x3fbc9a,_0x598f3b){const _0x29fc91=a16_0x5076,_0x328170=_0x3fbc9a();while(!![]){try{const _0x26101f=parseInt(_0x29fc91(0x1ad))/0x1+-parseInt(_0x29fc91(0x1b4))/0x2+-parseInt(_0x29fc91(0x19e))/0x3+parseInt(_0x29fc91(0x199))/0x4*(parseInt(_0x29fc91(0x1a0))/0x5)+-parseInt(_0x29fc91(0x1a7))/0x6+-parseInt(_0x29fc91(0x1c0))/0x7*(parseInt(_0x29fc91(0x1b1))/0x8)+parseInt(_0x29fc91(0x1ce))/0x9*(parseInt(_0x29fc91(0x1d0))/0xa);if(_0x26101f===_0x598f3b)break;else _0x328170['push'](_0x328170['shift']());}catch(_0x450144){_0x328170['push'](_0x328170['shift']());}}}(a16_0x5059,0x1fae8));function a16_0x5076(_0xb912ae,_0x507609){const _0x5059f6=a16_0x5059();return a16_0x5076=function(_0x5076c8,_0x7582a3){_0x5076c8=_0x5076c8-0x198;let _0x1d01f0=_0x5059f6[_0x5076c8];return _0x1d01f0;},a16_0x5076(_0xb912ae,_0x507609);}const os=require('os');function a16_0x5059(){const _0x30c277=['\x5cdva\x5cautomatic\x5crouter.js','common/color','common/tools','\x5cwebsite\x5cindex.js','567147UfOuQV','\x5cEditor\x5cindex.js','75EcIqMY','now','jjb-common/website','common/http','CLI_DVA_ROUTER_PATH','CLI_DVA_REGISTER_PATH','d4wQ7dzEjYPsgVbKnYei','699906rcsoJg','jjb-common/http','CLI_DVA_ROUTER_SPA','gPSit8aJsLVmNzuQ5Cy4','\x5cdva\x5cautomatic\x5cregister.js','\x5c..\x5ccli.dva.router.spa.txt','216974IhkPQM','GIT_HOST','return\x20process.env;','jjb-common/crypto','56CTzVJX','COMMON_CONTENT_NOR_REPLACE','common/crypto','142964pDcClh','COMMON_CONTENT_SPA_REPLACE','TEMPLATE_FOLDER','CLI_DVA_REGISTER_SAAS','G4HJRsHr9D7Ssmixegw2','\x5cPageHeaderBar\x5cindex.js','hLqARY89CN6fUD3yg4NL','\x5cImageUploader\x5cindex.js','\x5c..\x5ccli.dva.register.saas.txt','common/website','jjb-common/tools','\x5ctools\x5cindex.js','200613vsIjsZ','\x5c..\x5ccli.dva.register.spa.txt','\x5cRouterContainer\x5ccomponents\x5cNavigationTab\x5cindex.js','return\x20__planA();','components','\x5cRouterMenu\x5cindex.js','jjb-common/color','tmpdir','FT3pKzxpRynFkmddJ9Bs','CLI_DVA_REGISTER_SPA','COMPONENTS_CONTENT_REPLACE','const\x20relation\x20=\x20require(\x27~/enumerate/menu\x27).default;','CLI_DVA_ROUTER_SAAS','e9njpBd1nS_LREN8GFpR','9pDzfZc','http://192.168.1.242:10985','3786440WacaBy','\x5cRouterContainer\x5cindex.js','jjbAssembly_','GIT_TEMP_DIR','jjb-react-admin-component','29852FbcboO'];a16_0x5059=function(){return _0x30c277;};return a16_0x5059();}exports[a16_0x454360(0x1ae)]=a16_0x454360(0x1cf),exports[a16_0x454360(0x1d3)]=a16_0x454360(0x1d2)+Date[a16_0x454360(0x1a1)](),exports['CLOUD_PROJECT']={'common':{'token':a16_0x454360(0x1b8),'projectId':0x117},'react-admin-component':{'token':a16_0x454360(0x1c8),'projectId':0x154},'jjb-dva-runtime':{'token':a16_0x454360(0x1ba),'projectId':0x23b},'jjb-common-lib':{'token':a16_0x454360(0x1cd),'projectId':0x23c},'jjb-common-decorator':{'token':a16_0x454360(0x1aa),'projectId':0x23e},'vue-unisass-component':{'token':a16_0x454360(0x1a6),'projectId':0x153}},exports[a16_0x454360(0x1b6)]=os[a16_0x454360(0x1c7)]()+'\x5c'+exports['GIT_TEMP_DIR'],exports[a16_0x454360(0x1a9)]=__dirname+a16_0x454360(0x1ac),exports[a16_0x454360(0x1cc)]=__dirname+'\x5c..\x5ccli.dva.router.saas.txt',exports[a16_0x454360(0x1c9)]=__dirname+a16_0x454360(0x1c1),exports[a16_0x454360(0x1b7)]=__dirname+a16_0x454360(0x1bc),exports[a16_0x454360(0x1a4)]=a16_0x454360(0x19a),exports[a16_0x454360(0x1a5)]=a16_0x454360(0x1ab),exports[a16_0x454360(0x1b2)]=[{'path':a16_0x454360(0x1bf),'replace':[[a16_0x454360(0x1c4),a16_0x454360(0x198)]]},{'path':a16_0x454360(0x19d),'replace':[[/const\srelation\s=\srequire\(`~\/application\/\${module.code}\/enumerate\/menu`\)\.default;/,a16_0x454360(0x1cb)],[a16_0x454360(0x1c4),a16_0x454360(0x198)]]}],exports[a16_0x454360(0x1b5)]=[{'path':'\x5ctools\x5cindex.js','replace':[['return\x20__planA();',a16_0x454360(0x1af)]]}],exports['COMMON_CONTENT_MICRO_REPLACE']=[{'path':a16_0x454360(0x1bf),'replace':[[a16_0x454360(0x1c3),'return\x20process.env.app;']]}],exports[a16_0x454360(0x1ca)]=[{'path':a16_0x454360(0x19f),'replace':[[a16_0x454360(0x1a3),a16_0x454360(0x1a8)],[a16_0x454360(0x1b3),a16_0x454360(0x1b0)],[a16_0x454360(0x19c),'jjb-common/tools']]},{'path':'\x5cRejectText\x5cindex.js','replace':[[a16_0x454360(0x19b),'jjb-common/color']]},{'path':a16_0x454360(0x1c5),'replace':[[a16_0x454360(0x19c),a16_0x454360(0x1be)]]},{'path':'\x5cFileUploader\x5cindex.js','replace':[['common/http',a16_0x454360(0x1a8)],['common/tools',a16_0x454360(0x1be)]]},{'path':'\x5cImageCropper\x5cindex.js','replace':[[a16_0x454360(0x1a3),a16_0x454360(0x1a8)],[a16_0x454360(0x19c),a16_0x454360(0x1be)]]},{'path':a16_0x454360(0x1bb),'replace':[[a16_0x454360(0x1a3),a16_0x454360(0x1a8)],['common/tools',a16_0x454360(0x1be)]]},{'path':a16_0x454360(0x1b9),'replace':[['common/color',a16_0x454360(0x1c6)]]},{'path':a16_0x454360(0x1d1),'replace':[['common/tools',a16_0x454360(0x1be)]]},{'path':a16_0x454360(0x1c2),'replace':[[a16_0x454360(0x1bd),a16_0x454360(0x1a2)],[a16_0x454360(0x19c),a16_0x454360(0x1be)]]}];
1
+ const os = require('os');
2
+
3
+ exports.GIT_HOST = 'http://192.168.1.242:10985';
4
+ exports.GIT_TEMP_DIR = `jjbAssembly_${Date.now()}`;
5
+ exports.CLOUD_PROJECT = {
6
+ 'common': {
7
+ token: 'G4HJRsHr9D7Ssmixegw2',
8
+ projectId: 279
9
+ },
10
+ 'react-admin-component': {
11
+ token: 'FT3pKzxpRynFkmddJ9Bs',
12
+ projectId: 340
13
+ },
14
+ 'jjb-dva-runtime': {
15
+ token: 'hLqARY89CN6fUD3yg4NL',
16
+ projectId: 571
17
+ },
18
+ 'jjb-common-lib': {
19
+ token: 'e9njpBd1nS_LREN8GFpR',
20
+ projectId: 572
21
+ },
22
+ 'jjb-common-decorator': {
23
+ token: 'gPSit8aJsLVmNzuQ5Cy4',
24
+ projectId: 574
25
+ },
26
+ 'vue-unisass-component': {
27
+ token: 'd4wQ7dzEjYPsgVbKnYei',
28
+ projectId: 339
29
+ },
30
+ };
31
+ exports.TEMPLATE_FOLDER = `${os.tmpdir()}\\${exports.GIT_TEMP_DIR}`;
32
+ exports.CLI_DVA_ROUTER_SPA = `${__dirname}\\..\\cli.dva.router.spa.txt`;
33
+ exports.CLI_DVA_ROUTER_SAAS = `${__dirname}\\..\\cli.dva.router.saas.txt`;
34
+ exports.CLI_DVA_REGISTER_SPA = `${__dirname}\\..\\cli.dva.register.spa.txt`;
35
+ exports.CLI_DVA_REGISTER_SAAS = `${__dirname}\\..\\cli.dva.register.saas.txt`;
36
+ exports.CLI_DVA_ROUTER_PATH = '\\dva\\automatic\\router.js';
37
+ exports.CLI_DVA_REGISTER_PATH = '\\dva\\automatic\\register.js';
38
+
39
+ exports.COMMON_CONTENT_NOR_REPLACE = [
40
+ {
41
+ path: `\\tools\\index.js`,
42
+ replace: [
43
+ [
44
+ 'components',
45
+ 'jjb-react-admin-component'
46
+ ]
47
+ ]
48
+ },
49
+ {
50
+ path: `\\website\\index.js`,
51
+ replace: [
52
+ [
53
+ /const\srelation\s=\srequire\(`~\/application\/\${module.code}\/enumerate\/menu`\)\.default;/,
54
+ 'const relation = require(\'~/enumerate/menu\').default;'
55
+ ],
56
+ [
57
+ 'components',
58
+ 'jjb-react-admin-component'
59
+ ]
60
+ ]
61
+ }
62
+ ];
63
+
64
+ /**
65
+ * @description 需要替换的文本(单应用)
66
+ * @type {[{path: string, replace: string[][]}]}
67
+ */
68
+ exports.COMMON_CONTENT_SPA_REPLACE = [
69
+ {
70
+ path: `\\tools\\index.js`,
71
+ replace: [
72
+ [
73
+ 'return __planA();',
74
+ 'return process.env;'
75
+ ]
76
+ ]
77
+ }
78
+ ];
79
+
80
+ /**
81
+ * @description 需要替换的文本(微应用)
82
+ * @type {[{path: string, replace: string[][]}]}
83
+ */
84
+ exports.COMMON_CONTENT_MICRO_REPLACE = [
85
+ {
86
+ path: `\\tools\\index.js`,
87
+ replace: [
88
+ [
89
+ 'return __planA();',
90
+ 'return process.env.app;'
91
+ ]
92
+ ]
93
+ }
94
+ ];
95
+
96
+ /**
97
+ * @description react-admin-component 需要替换的文本
98
+ * @type {[{path: string, replace: string[][]},{path: string, replace: string[][]},{path: string, replace: string[][]},{path: string, replace: string[][]},{path: string, replace: string[][]},null,null,null,null]}
99
+ */
100
+ exports.COMPONENTS_CONTENT_REPLACE = [
101
+ {
102
+ path: `\\Editor\\index.js`,
103
+ replace: [
104
+ [
105
+ 'common/http',
106
+ 'jjb-common/http'
107
+ ],
108
+ [
109
+ 'common/crypto',
110
+ 'jjb-common/crypto'
111
+ ],
112
+ [
113
+ 'common/tools',
114
+ 'jjb-common/tools'
115
+ ]
116
+ ]
117
+ },
118
+ {
119
+ path: `\\RejectText\\index.js`,
120
+ replace: [
121
+ [
122
+ 'common/color',
123
+ 'jjb-common/color'
124
+ ]
125
+ ]
126
+ },
127
+ {
128
+ path: `\\RouterMenu\\index.js`,
129
+ replace: [
130
+ [
131
+ 'common/tools',
132
+ 'jjb-common/tools'
133
+ ]
134
+ ]
135
+ },
136
+ {
137
+ path: `\\FileUploader\\index.js`,
138
+ replace: [
139
+ [
140
+ 'common/http',
141
+ 'jjb-common/http'
142
+ ],
143
+ [
144
+ 'common/tools',
145
+ 'jjb-common/tools'
146
+ ]
147
+ ]
148
+ },
149
+ {
150
+ path: `\\ImageCropper\\index.js`,
151
+ replace: [
152
+ [
153
+ 'common/http',
154
+ 'jjb-common/http'
155
+ ],
156
+ [
157
+ 'common/tools',
158
+ 'jjb-common/tools'
159
+ ]
160
+ ]
161
+ },
162
+ {
163
+ path: `\\ImageUploader\\index.js`,
164
+ replace: [
165
+ [
166
+ 'common/http',
167
+ 'jjb-common/http'
168
+ ],
169
+ [
170
+ 'common/tools',
171
+ 'jjb-common/tools'
172
+ ]
173
+ ]
174
+ },
175
+ {
176
+ path: `\\PageHeaderBar\\index.js`,
177
+ replace: [
178
+ [
179
+ 'common/color',
180
+ 'jjb-common/color'
181
+ ]
182
+ ]
183
+ },
184
+ {
185
+ path: `\\RouterContainer\\index.js`,
186
+ replace: [
187
+ [
188
+ 'common/tools',
189
+ 'jjb-common/tools'
190
+ ]
191
+ ]
192
+ },
193
+ {
194
+ path: `\\RouterContainer\\components\\NavigationTab\\index.js`,
195
+ replace: [
196
+ [
197
+ 'common/website',
198
+ 'jjb-common/website'
199
+ ],
200
+ [
201
+ 'common/tools',
202
+ 'jjb-common/tools'
203
+ ]
204
+ ]
205
+ }
206
+ ];