修改了makeAppDomain,从oakExteralLib中读出依赖的库,修正了模板的index.html,不再依赖unpkg.com
This commit is contained in:
parent
45866b0ef0
commit
192ebf1859
|
|
@ -1,10 +1,23 @@
|
|||
const { existsSync } = require('fs');
|
||||
const { removeSync } = require('fs-extra');
|
||||
const { join } = require('path');
|
||||
const {
|
||||
buildSchema,
|
||||
analyzeEntities,
|
||||
} = require(`${process.cwd()}/node_modules/oak-domain/lib/compiler/schemalBuilder`);
|
||||
|
||||
// todo,这里还是很奇怪,要把src/entites的依赖给去掉
|
||||
analyzeEntities(`${process.cwd()}/node_modules/oak-domain/src/entities`, 'oak-domain/lib/entities');
|
||||
analyzeEntities(`${process.cwd()}/node_modules/oak-general-business/src/entities`, 'oak-general-business/lib/entities');
|
||||
analyzeEntities(`${process.cwd()}/src/entities`);
|
||||
buildSchema(`${process.cwd()}/src/oak-app-domain`);
|
||||
// 从config中读出相应依赖
|
||||
const externalLibFile = join(process.cwd(), 'src', 'config', 'oakExternalLib.json');
|
||||
if (existsSync(externalLibFile)) {
|
||||
const exteralLibs = require(externalLibFile);
|
||||
exteralLibs.forEach(
|
||||
(ele) => {
|
||||
analyzeEntities(`${process.cwd()}/node_modules/${ele}/src/entities`, `${ele}/lib/entities`);
|
||||
}
|
||||
);
|
||||
}
|
||||
analyzeEntities(join(process.cwd(), 'src', 'entities'));
|
||||
removeSync(join(process.cwd(), 'src', 'oak-app-domain'));
|
||||
buildSchema(join(process.cwd(), 'src', 'oak-app-domain'));
|
||||
|
|
@ -1,38 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="Web site created using create-react-app" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<!--
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<link rel="stylesheet" href="//g.alicdn.com/de/prismplayer/2.11.0/skins/default/aliplayer-min.css" />
|
||||
<!-- <link rel="stylesheet" type="text/css" charset="UTF-8" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="//g.alicdn.com/de/prismplayer/2.11.0/skins/default/aliplayer-min.css"
|
||||
/>
|
||||
<!-- <link rel="stylesheet" type="text/css" charset="UTF-8" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" /> -->
|
||||
<script charset="utf-8" type="text/javascript"
|
||||
src="//g.alicdn.com/de/prismplayer/2.11.0/aliplayer-h5-min.js"></script>
|
||||
<script src="//unpkg.com/react@18.2.0/umd/react.production.min.js"></script>
|
||||
<script src="//unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"></script>
|
||||
<script src="//unpkg.com/echarts@5.4.0/dist/echarts.min.js"></script>
|
||||
<script src="//unpkg.com/lodash@4.17.21/lodash.js"></script>
|
||||
<!-- <script src="//unpkg.com/@wangeditor/basic-modules@1.1.6/dist/index.js"></script> -->
|
||||
<!-- <link href="//unpkg.com/@wangeditor/editor@latest/dist/css/style.css" rel="stylesheet">
|
||||
<script
|
||||
charset="utf-8"
|
||||
type="text/javascript"
|
||||
src="//g.alicdn.com/de/prismplayer/2.11.0/aliplayer-h5-min.js"
|
||||
></script>
|
||||
<script src="//cdn.staticfile.org/react/18.2.0/umd/react.production.min.js"></script>
|
||||
<script>
|
||||
window.React || document.write('<script src="//cdn.bootcdn.net/ajax/libs/react/18.2.0/umd/react.production.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.React || document.write('<script src="//unpkg.com/react@18.2.0/umd/react.production.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//cdn.staticfile.org/react-dom/18.2.0/umd/react-dom.production.min.js"></script>
|
||||
<script>
|
||||
window.ReactDOM || document.write('<script src="//cdn.bootcdn.net/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.ReactDOM || document.write('<script src="//unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//cdn.staticfile.org/echarts/5.4.3/echarts.min.js"></script>
|
||||
<script>
|
||||
window.echarts || document.write('<script src="//unpkg.com/echarts@5.4.0/dist/echarts.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//cdn.staticfile.org/lodash.js/4.17.21/lodash.min.js"></script>
|
||||
<script>
|
||||
window._ || document.write('<script src="//cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window._ || document.write('<script src="//unpkg.com/lodash@4.17.21/lodash.js"><\/script>')
|
||||
</script>
|
||||
<!-- <script src="//unpkg.com/@wangeditor/basic-modules@1.1.6/dist/index.js"></script> -->
|
||||
<!-- <link href="//unpkg.com/@wangeditor/editor@latest/dist/css/style.css" rel="stylesheet">
|
||||
<script src="//unpkg.com/@wangeditor/editor@latest/dist/index.js"></script> -->
|
||||
<link href="//cdn.staticfile.org/wangeditor5/5.1.22/css/style.min.css" rel="stylesheet" />
|
||||
<script src="//cdn.staticfile.org/wangeditor5/5.1.22/index.js"></script>
|
||||
<script src="//unpkg.com/@fingerprintjs/fingerprintjs@3.3.6/dist/fp.min.js"></script>
|
||||
<script src="//unpkg.com/bn.js@5.2.1/lib/bn.js"></script>
|
||||
<!-- <script src="https://cdn.staticfile.org/dayjs/1.11.7/dayjs.min.js"></script> -->
|
||||
<!-- <script src="//cdn.bootcdn.net/ajax/libs/antd/5.2.0/antd.min.js"></script> -->
|
||||
<!-- <link href="//cdn.bootcdn.net/ajax/libs/antd/5.2.0/reset.min.css" rel="stylesheet"> -->
|
||||
<!--
|
||||
<link href="//cdn.staticfile.org/wangeditor5/5.1.22/css/style.min.css" rel="stylesheet" />
|
||||
<script src="//cdn.staticfile.org/wangeditor5/5.1.22/index.js"></script>
|
||||
<script>
|
||||
window.wangEditor || document.write('<script src="//cdn.bootcdn.net/ajax/libs/wangeditor5/5.1.22/index.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//qiniu.gecomebox.com/static/cdn/fp.min.js"></script>
|
||||
<script>
|
||||
window.FingerprintJS || document.write('<script src="//cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3.3.6/dist/fp.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.FingerprintJS || document.write('<script src="//unpkg.com/@fingerprintjs/fingerprintjs@3.3.6/dist/fp.min.js"><\/script>')
|
||||
</script>
|
||||
|
||||
<script src="//qiniu.gecomebox.com/static/cdn/bn.min.js"></script>
|
||||
<script>
|
||||
window.BN || document.write('<script src="//cdn.jsdelivr.net/npm/bn.js@5.2.1/lib/bn.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.BN || document.write('<script src="//unpkg.com/bn.js@5.2.1/lib/bn.js"><\/script>')
|
||||
</script>
|
||||
<!-- <script src="https://cdn.staticfile.org/dayjs/1.11.7/dayjs.min.js"></script> -->
|
||||
<!-- <script src="//cdn.bootcdn.net/ajax/libs/antd/5.2.0/antd.min.js"></script> -->
|
||||
<!-- <link href="//cdn.bootcdn.net/ajax/libs/antd/5.2.0/reset.min.css" rel="stylesheet"> -->
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
|
@ -41,18 +86,18 @@
|
|||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>oak template project</title>
|
||||
<!-- <script>window.antd || document.write('<script src="https://cdn.staticfile.org/antd/5.2.0/antd.min.js"><\/script>')</script> -->
|
||||
<!-- <script>window.antd || document.write('<link href="https://cdn.staticfile.org/antd/5.2.0/reset.min.css" rel="stylesheet"><\/link>')</script> -->
|
||||
<title>oak template project</title>
|
||||
<!-- <script>window.antd || document.write('<script src="https://cdn.staticfile.org/antd/5.2.0/antd.min.js"><\/script>')</script> -->
|
||||
<!-- <script>window.antd || document.write('<link href="https://cdn.staticfile.org/antd/5.2.0/reset.min.css" rel="stylesheet"><\/link>')</script> -->
|
||||
|
||||
<script>
|
||||
</script>
|
||||
</head>
|
||||
<script>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
|
|
@ -61,7 +106,115 @@
|
|||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
--></body>
|
||||
|
||||
</html>
|
||||
<script>
|
||||
function getBrowserVersion() {
|
||||
var sys = {};
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
var s;
|
||||
(s = ua.match(/firefox\/([\d.]+)/))
|
||||
? (sys.firefox = s[1])
|
||||
: (s = ua.match(/chrome\/([\d.]+)/))
|
||||
? (sys.chrome = s[1])
|
||||
: (s = ua.match(/opera.([\d.]+)/))
|
||||
? (sys.opera = s[1])
|
||||
: (s = ua.match(/rv:([\d.]+)/))
|
||||
? (sys.ie = s[1])
|
||||
: (s = ua.match(/msie ([\d.]+)/))
|
||||
? (sys.ie = s[1])
|
||||
: (s = ua.match(/version\/([\d.]+).*safari/))
|
||||
? (sys.safari = s[1])
|
||||
: 0;
|
||||
var browser = 'Unknown';
|
||||
var tip = document.createElement('div');
|
||||
var closeBtn = document.createElement('img');
|
||||
var contentHTML =
|
||||
'您当前使用的浏览器可能会出现界面显示异常或功能无法正常使用等问题,建议下载使用最新的 360 极速浏览器并切换到极速模式。';
|
||||
// var endHTML =
|
||||
// ' <a href="../assets/360cse_13.0.2216.0.exe" target="_blank" style="cursor: pointer; color: red; font-weight: bold;">下载浏览器点我</a> <a href="../../views/speed-mode-tutorial.html" target="_blank" style="cursor: pointer; color: red; font-weight: bold;">不会切换到极速模式点我</a>';
|
||||
var handleClickClose = function (event) {
|
||||
document.body.removeChild(tip);
|
||||
};
|
||||
var startAppend = function () {
|
||||
document.body.appendChild(tip);
|
||||
tip.appendChild(closeBtn);
|
||||
};
|
||||
|
||||
closeBtn.style.position = 'absolute';
|
||||
closeBtn.style.right = '20px';
|
||||
closeBtn.style.bottom = '7px';
|
||||
closeBtn.style.cursor = 'pointer';
|
||||
closeBtn.style.width = '15px';
|
||||
closeBtn.style.height = '15px';
|
||||
closeBtn.src = '../assets/images/icon-close.png';
|
||||
closeBtn.alt = '关闭';
|
||||
|
||||
if (closeBtn.addEventListener) {
|
||||
closeBtn.addEventListener('click', handleClickClose);
|
||||
} else {
|
||||
// IE8 及以下
|
||||
closeBtn.attachEvent('onclick', handleClickClose);
|
||||
}
|
||||
|
||||
tip.style.position = 'relative';
|
||||
tip.style.backgroundColor = 'yellow';
|
||||
tip.style.color = 'red';
|
||||
tip.style.position = 'fixed';
|
||||
tip.style.top = 0;
|
||||
tip.style.right = 0;
|
||||
tip.style.left = 0;
|
||||
tip.style.padding = '5px 20px';
|
||||
tip.style.fontSize = '14px';
|
||||
|
||||
if (sys.ie) {
|
||||
browser = 'IE';
|
||||
tip.innerHTML = contentHTML + endHTML;
|
||||
startAppend();
|
||||
}
|
||||
if (sys.firefox) {
|
||||
browser = 'Firefox';
|
||||
tip.innerHTML = contentHTML + endHTML;
|
||||
startAppend();
|
||||
}
|
||||
if (sys.chrome) {
|
||||
browser = 'Chrome';
|
||||
|
||||
var getChromeVersion = function () {
|
||||
var arr = navigator.userAgent.split(' ');
|
||||
var chromeVersion = '';
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (/chrome/i.test(arr[i])) chromeVersion = arr[i];
|
||||
}
|
||||
if (chromeVersion) {
|
||||
return Number(
|
||||
chromeVersion.split('/')[1].split('.')[0]
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (getChromeVersion()) {
|
||||
var version = getChromeVersion();
|
||||
// 如果 360 极速浏览器并切换到极速模式低于86版本
|
||||
if (version < 87) {
|
||||
tip.innerHTML =
|
||||
'您当前使用的浏览器版本过低,使用可能会出现界面显示异常或功能无法正常使用等问题,建议下载使用谷歌,火狐,edge等新版本浏览器。' +
|
||||
endHTML;
|
||||
startAppend();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sys.opera) {
|
||||
browser = 'Opera';
|
||||
tip.innerHTML = contentHTML + endHTML;
|
||||
startAppend();
|
||||
}
|
||||
if (sys.safari) {
|
||||
browser = 'Safari';
|
||||
}
|
||||
}
|
||||
getBrowserVersion();
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in New Issue