jjb-cmd 2.2.2 → 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_0x2bf0d9=a15_0x4f19;(function(_0xa997b9,_0x1014e3){const _0x485949=a15_0x4f19,_0x39c654=_0xa997b9();while(!![]){try{const _0x50bde1=parseInt(_0x485949(0x79))/0x1*(-parseInt(_0x485949(0x7c))/0x2)+parseInt(_0x485949(0x7e))/0x3*(-parseInt(_0x485949(0x88))/0x4)+-parseInt(_0x485949(0x84))/0x5*(parseInt(_0x485949(0x7b))/0x6)+-parseInt(_0x485949(0x8b))/0x7*(parseInt(_0x485949(0x81))/0x8)+parseInt(_0x485949(0x7d))/0x9+parseInt(_0x485949(0x83))/0xa+parseInt(_0x485949(0x76))/0xb*(parseInt(_0x485949(0x85))/0xc);if(_0x50bde1===_0x1014e3)break;else _0x39c654['push'](_0x39c654['shift']());}catch(_0x321361){_0x39c654['push'](_0x39c654['shift']());}}}(a15_0x2d55,0x98bb2));function a15_0x4f19(_0x37313a,_0x3d7f91){const _0x2d5550=a15_0x2d55();return a15_0x4f19=function(_0x4f196d,_0x9a1497){_0x4f196d=_0x4f196d-0x73;let _0x3f5ba3=_0x2d5550[_0x4f196d];return _0x3f5ba3;},a15_0x4f19(_0x37313a,_0x3d7f91);}const path=require('path'),readline=require(a15_0x2bf0d9(0x7a)),{f_file_copy}=require(a15_0x2bf0d9(0x89)),fs=require('fs');function a15_0x2d55(){const _0xd18687=['174210UCJfmb','22TbPYNG','1925874VRYeFi','2388297jkGTYq','\x5cpackage.json','\x5cwebstorm.config.js','940256ZDqEDN','exit','1771800SSEAmv','25IhDIUR','3165132AoNscO','\x5cjjb.script','existsSync','4mLTPfh','./cli.install/tools','初始化失败,文件已存在!','35GDgEtA','\x5ccli.init','resolve','log','77eFiIKj','exports','\x5cjjb.config.json','7543lieuMO','readline'];a15_0x2d55=function(){return _0xd18687;};return a15_0x2d55();}module[a15_0x2bf0d9(0x77)]=()=>{const _0x218bd7=a15_0x2bf0d9,_0x2c18b7=path[_0x218bd7(0x74)]('./');!fs[_0x218bd7(0x87)](_0x2c18b7+_0x218bd7(0x86))&&!fs['existsSync'](_0x2c18b7+'\x5cpublic')&&!fs['existsSync'](_0x2c18b7+_0x218bd7(0x78))&&!fs[_0x218bd7(0x87)](_0x2c18b7+_0x218bd7(0x7f))&&!fs[_0x218bd7(0x87)](_0x2c18b7+_0x218bd7(0x80))?(f_file_copy(__dirname+_0x218bd7(0x73),_0x2c18b7),console[_0x218bd7(0x75)]('初始化完成!'),process[_0x218bd7(0x82)](0x0)):(console[_0x218bd7(0x75)](_0x218bd7(0x8a)),process[_0x218bd7(0x82)](0x0));};
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
- function a16_0xe169(){const _0x2ff61f=['jjb-common/crypto','\x5cRejectText\x5cindex.js','return\x20process.env;','\x5cdva\x5cautomatic\x5cregister.js','COMPONENTS_CONTENT_REPLACE','\x5cImageUploader\x5cindex.js','G4HJRsHr9D7Ssmixegw2','CLI_DVA_ROUTER_PATH','\x5cFileUploader\x5cindex.js','82055flbIVr','CLOUD_PROJECT','jjb-common/website','COMMON_CONTENT_MICRO_REPLACE','common/http','jjb-react-admin-component','1204160rrVTEZ','common/color','\x5c..\x5ccli.dva.router.saas.txt','\x5c..\x5ccli.dva.register.spa.txt','tmpdir','87vLdqvK','210iLnUbi','\x5cdva\x5cautomatic\x5crouter.js','\x5cRouterContainer\x5cindex.js','13852920ElpcnF','now','\x5ctools\x5cindex.js','\x5cRouterMenu\x5cindex.js','\x5c..\x5ccli.dva.register.saas.txt','\x5cwebsite\x5cindex.js','8169aRNgMO','return\x20process.env.app;','32974RHDGWy','40RkiTww','GIT_TEMP_DIR','GIT_HOST','2552gMRokk','\x5c..\x5ccli.dva.router.spa.txt','7658BiLhWW','hLqARY89CN6fUD3yg4NL','jjb-common/color','jjb-common/http','jjbAssembly_','\x5cRouterContainer\x5ccomponents\x5cNavigationTab\x5cindex.js','common/website','COMMON_CONTENT_SPA_REPLACE','common/crypto','37110BEIAwo','components','TEMPLATE_FOLDER','common/tools','\x5cImageCropper\x5cindex.js','CLI_DVA_REGISTER_PATH','e9njpBd1nS_LREN8GFpR','9sCOlyn','return\x20__planA();','jjb-common/tools'];a16_0xe169=function(){return _0x2ff61f;};return a16_0xe169();}const a16_0x1634f9=a16_0x7622;function a16_0x7622(_0x2926e5,_0x39a289){const _0xe16975=a16_0xe169();return a16_0x7622=function(_0x7622a9,_0x369c4a){_0x7622a9=_0x7622a9-0x9b;let _0x468e1c=_0xe16975[_0x7622a9];return _0x468e1c;},a16_0x7622(_0x2926e5,_0x39a289);}(function(_0x27d34e,_0x293dc2){const _0x142055=a16_0x7622,_0x5d3621=_0x27d34e();while(!![]){try{const _0xa7f556=-parseInt(_0x142055(0xd0))/0x1+-parseInt(_0x142055(0xd2))/0x2*(-parseInt(_0x142055(0xc6))/0x3)+-parseInt(_0x142055(0xd3))/0x4*(-parseInt(_0x142055(0xbb))/0x5)+parseInt(_0x142055(0xc7))/0x6*(-parseInt(_0x142055(0x9f))/0x7)+parseInt(_0x142055(0xc1))/0x8*(parseInt(_0x142055(0xaf))/0x9)+-parseInt(_0x142055(0xa8))/0xa*(-parseInt(_0x142055(0x9d))/0xb)+-parseInt(_0x142055(0xca))/0xc;if(_0xa7f556===_0x293dc2)break;else _0x5d3621['push'](_0x5d3621['shift']());}catch(_0x63fcd7){_0x5d3621['push'](_0x5d3621['shift']());}}}(a16_0xe169,0x6e8e4));const os=require('os');exports[a16_0x1634f9(0x9c)]='http://192.168.1.242:10985',exports[a16_0x1634f9(0x9b)]=a16_0x1634f9(0xa3)+Date[a16_0x1634f9(0xcb)](),exports[a16_0x1634f9(0xbc)]={'common':{'token':a16_0x1634f9(0xb8),'projectId':0x117},'react-admin-component':{'token':'FT3pKzxpRynFkmddJ9Bs','projectId':0x154},'jjb-dva-runtime':{'token':a16_0x1634f9(0xa0),'projectId':0x23b},'jjb-common-lib':{'token':a16_0x1634f9(0xae),'projectId':0x23c},'jjb-common-decorator':{'token':'gPSit8aJsLVmNzuQ5Cy4','projectId':0x23e},'vue-unisass-component':{'token':'d4wQ7dzEjYPsgVbKnYei','projectId':0x153}},exports[a16_0x1634f9(0xaa)]=os[a16_0x1634f9(0xc5)]()+'\x5c'+exports[a16_0x1634f9(0x9b)],exports['CLI_DVA_ROUTER_SPA']=__dirname+a16_0x1634f9(0x9e),exports['CLI_DVA_ROUTER_SAAS']=__dirname+a16_0x1634f9(0xc3),exports['CLI_DVA_REGISTER_SPA']=__dirname+a16_0x1634f9(0xc4),exports['CLI_DVA_REGISTER_SAAS']=__dirname+a16_0x1634f9(0xce),exports[a16_0x1634f9(0xb9)]=a16_0x1634f9(0xc8),exports[a16_0x1634f9(0xad)]=a16_0x1634f9(0xb5),exports['COMMON_CONTENT_NOR_REPLACE']=[{'path':'\x5ctools\x5cindex.js','replace':[['components',a16_0x1634f9(0xc0)]]},{'path':a16_0x1634f9(0xcf),'replace':[[/const\srelation\s=\srequire\(`~\/application\/\${module.code}\/enumerate\/menu`\)\.default;/,'const\x20relation\x20=\x20require(\x27~/enumerate/menu\x27).default;'],[a16_0x1634f9(0xa9),'jjb-react-admin-component']]}],exports[a16_0x1634f9(0xa6)]=[{'path':'\x5ctools\x5cindex.js','replace':[[a16_0x1634f9(0xb0),a16_0x1634f9(0xb4)]]}],exports[a16_0x1634f9(0xbe)]=[{'path':a16_0x1634f9(0xcc),'replace':[['return\x20__planA();',a16_0x1634f9(0xd1)]]}],exports[a16_0x1634f9(0xb6)]=[{'path':'\x5cEditor\x5cindex.js','replace':[[a16_0x1634f9(0xbf),a16_0x1634f9(0xa2)],[a16_0x1634f9(0xa7),a16_0x1634f9(0xb2)],[a16_0x1634f9(0xab),a16_0x1634f9(0xb1)]]},{'path':a16_0x1634f9(0xb3),'replace':[[a16_0x1634f9(0xc2),a16_0x1634f9(0xa1)]]},{'path':a16_0x1634f9(0xcd),'replace':[[a16_0x1634f9(0xab),a16_0x1634f9(0xb1)]]},{'path':a16_0x1634f9(0xba),'replace':[[a16_0x1634f9(0xbf),a16_0x1634f9(0xa2)],['common/tools',a16_0x1634f9(0xb1)]]},{'path':a16_0x1634f9(0xac),'replace':[[a16_0x1634f9(0xbf),a16_0x1634f9(0xa2)],['common/tools',a16_0x1634f9(0xb1)]]},{'path':a16_0x1634f9(0xb7),'replace':[[a16_0x1634f9(0xbf),a16_0x1634f9(0xa2)],['common/tools',a16_0x1634f9(0xb1)]]},{'path':'\x5cPageHeaderBar\x5cindex.js','replace':[[a16_0x1634f9(0xc2),a16_0x1634f9(0xa1)]]},{'path':a16_0x1634f9(0xc9),'replace':[[a16_0x1634f9(0xab),a16_0x1634f9(0xb1)]]},{'path':a16_0x1634f9(0xa4),'replace':[[a16_0x1634f9(0xa5),a16_0x1634f9(0xbd)],[a16_0x1634f9(0xab),a16_0x1634f9(0xb1)]]}];
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
+ ];