Luolei 6 anni fa
parent
commit
cf969cdac5

+ 2 - 0
src/html/disclaimer.html

@@ -38,6 +38,8 @@
       padding: 0 30px 40px;
     }
   </style>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function (oThis) {

+ 2 - 0
src/html/drugInfo.html

@@ -148,6 +148,8 @@
       color: #33475f
     }
   </style>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function (oThis) {

+ 2 - 0
src/html/index.html

@@ -5,6 +5,8 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title><%= htmlWebpackPlugin.options.title %></title>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function(oThis) {

+ 2 - 0
src/html/information.html

@@ -148,6 +148,8 @@
       color: #000
     }
   </style>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function (oThis) {

+ 2 - 0
src/html/page.html

@@ -6,6 +6,8 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title><%= htmlWebpackPlugin.options.title %></title>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function (oThis) {

+ 2 - 0
src/html/scale.html

@@ -118,6 +118,8 @@
       box-sizing: border-box;
     }
   </style>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
+  <script type="text/javascript" src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
   <script>
     if (!Function.prototype.bind) {
       Function.prototype.bind = function (oThis) {

+ 2 - 2
src/js/promise.js

@@ -1,5 +1,5 @@
+import '@babel/polyfill';;
 const qs = require('qs');
-import '@babel/polyfill'
 const config = {
   pushInner:'/api/icss/push/pushInner',
   calculate:'/api/icss/calc/calculate',
@@ -7,7 +7,7 @@ const config = {
   information: '/api/icss/introduceInfo/getByQuestionId',
 }
 const imageUrlPrefix = 'http://192.168.2.241:82';
-const getUrlArgObject = (parm) => {  
+const getUrlArgObject = function(parm) {  
   var query = window.location.search;
   var args = qs.parse(query.substr(1));
   return args[parm];//返回对象  

+ 4 - 9
webpack.config.js

@@ -117,15 +117,7 @@ module.exports = {
     minimizer: [
       new UglifyJsPlugin({
         uglifyOptions: {
-          warnings: false,
-          parse: {},
-          compress: {},
-          mangle: true, // Note `mangle.properties` is `false` by default.
-          output: null,
-          toplevel: false,
-          nameCache: null,
           ie8: true,
-          keep_fnames: false,
         },
       }),
     ],
@@ -154,7 +146,10 @@ module.exports = {
         use: {
           loader: 'babel-loader',
           options: {
-            presets: ['@babel/preset-env']
+            presets: ['@babel/preset-env',{
+              "loose" : true,//解决Object.defineProperty
+              "modules" : false
+            }]
           }
         }
       },