Browse Source

fix: proxy

lufeng 2 years ago
parent
commit
8e9a3bd5f1

+ 19 - 19
src/main/resources/static/app.config.js

@@ -267,25 +267,25 @@ if (appConfig.voice_command) {
267 267
 
268 268
 //服务器上面
269 269
 appConfig.apiRootUrl = 'api';
270
-appConfig.baseUrl = 'http://localhost:9025';
271
-appConfig.systemUrl = location.protocol+"//"+location.host+'/depot-system';
272
-appConfig.basicUrl = location.protocol+"//"+location.host+'/depot-basic';
273
-appConfig.keeperHouseUrl = location.protocol+"//"+location.host+'/depot-keeper-account';
274
-appConfig.paymentUrl = location.protocol+"//"+location.host+'/depot-payment';
275
-appConfig.depotStorageUrl = location.protocol+"//"+location.host+'/depot-storage';
276
-//appConfig.grainAnalysis = location.protocol+"//"+location.host+'/depot-grain-analysis';
277
-appConfig.houseKeeperRepairUrl = location.protocol+"//"+location.host+'/depot-keeper-house';
278
-//appConfig.taskUrl = location.protocol+"//"+location.host+'/depot-task';
279
-appConfig.qualitycheckUrl = location.protocol+"//"+location.host+'/depot-qualitycheck';
280
-appConfig.monitorUrl = location.protocol+"//"+location.host+'/depot-monitor';
281
-appConfig.superviseUrl = location.protocol+"//"+location.host+'/depot-supervise';
282
-appConfig.agileUrl = location.protocol+"//"+location.host+'/depot-agile';
283
-appConfig.businessUrl = location.protocol+"//"+location.host+'/depot-business';
284
-appConfig.deviceUrl = location.protocol+"//"+location.host+'/depot-device';
285
-appConfig.customerUrl = location.protocol+"//"+location.host+'/depot-customer';
286
-appConfig.agentUrl = location.protocol+"//"+location.host+'/depot-agent';
287
-appConfig.intelligentUrl = location.protocol+"//"+location.host+'/depot-intelligent';
288
-appConfig.sharedUrl = location.protocol+"//"+location.host+'/depot-shared';
270
+appConfig.baseUrl = '/proxy';
271
+appConfig.systemUrl = appConfig.baseUrl+'/depot-system';
272
+appConfig.basicUrl = appConfig.baseUrl+'/depot-basic';
273
+appConfig.keeperHouseUrl = appConfig.baseUrl+'/depot-keeper-account';
274
+appConfig.paymentUrl = appConfig.baseUrl+'/depot-payment';
275
+appConfig.depotStorageUrl = appConfig.baseUrl+'/depot-storage';
276
+//appConfig.grainAnalysis = appConfig.baseUrl+'/depot-grain-analysis';
277
+appConfig.houseKeeperRepairUrl = appConfig.baseUrl+'/depot-keeper-house';
278
+//appConfig.taskUrl = appConfig.baseUrl+'/depot-task';
279
+appConfig.qualitycheckUrl = appConfig.baseUrl+'/depot-qualitycheck';
280
+appConfig.monitorUrl = appConfig.baseUrl+'/depot-monitor';
281
+appConfig.superviseUrl = appConfig.baseUrl+'/depot-supervise';
282
+appConfig.agileUrl = appConfig.baseUrl+'/depot-agile';
283
+appConfig.businessUrl = appConfig.baseUrl+'/depot-business';
284
+appConfig.deviceUrl = appConfig.baseUrl+'/depot-device';
285
+appConfig.customerUrl = appConfig.baseUrl+'/depot-customer';
286
+appConfig.agentUrl = appConfig.baseUrl+'/depot-agent';
287
+appConfig.intelligentUrl = appConfig.baseUrl+'/depot-intelligent';
288
+appConfig.sharedUrl = appConfig.baseUrl+'/depot-shared';
289 289
 window.appConfig = appConfig;
290 290
 /*
291 291
 * END APP.appConfig

File diff suppressed because it is too large
+ 103482 - 103250
src/main/resources/static/build/app.js


File diff suppressed because it is too large
+ 4 - 4
src/main/resources/static/build/vendor.ui.js


+ 14 - 2
src/main/resources/static/gulpfile.js

@@ -7,7 +7,7 @@ var ngAnnotate = require('gulp-ng-annotate');
7 7
 var uglify = require('gulp-uglify');
8 8
 var fs = require('fs');
9 9
 var _ = require('lodash');
10
-
10
+var { createProxyMiddleware } = require('http-proxy-middleware');
11 11
 
12 12
 var scripts = require('./app.scripts.json');
13 13
 
@@ -60,7 +60,19 @@ gulp.task('watch', function(){
60 60
 
61 61
 gulp.task('connect', function() {
62 62
     connect.server({
63
-        port: 8888
63
+        port: 8888,
64
+        livereload: true,
65
+        middleware: function (connect, opt) {
66
+            return [
67
+                createProxyMiddleware('/proxy', {
68
+                    target: 'http://192.168.101.24:9025',//代理的目标地址
69
+                    changeOrigin: true,//
70
+                    pathRewrite: {//路径重写规则 
71
+                        '/proxy': ''
72
+                    }
73
+                })
74
+            ]
75
+        }
64 76
     });
65 77
 });
66 78
 

+ 3 - 2
src/main/resources/static/package.json

@@ -11,13 +11,13 @@
11 11
   "author": "Sunny",
12 12
   "license": "MyOrange Inc.",
13 13
   "devDependencies": {
14
+    "event-stream": "~3.3.1",
14 15
     "gulp": "^3.9.0",
15
-    "gulp-concat": "^2.6.0",
16 16
     "gulp-angular-templatecache": "^1.7.0",
17
+    "gulp-concat": "^2.6.0",
17 18
     "gulp-connect": "^2.2.0",
18 19
     "gulp-ng-annotate": "^1.0.0",
19 20
     "gulp-uglify": "^1.2.0",
20
-    "event-stream": "~3.3.1",
21 21
     "lodash": "^4.0.0"
22 22
   },
23 23
   "dependencies": {
@@ -25,6 +25,7 @@
25 25
     "angular-messages": "^1.4.14",
26 26
     "datetimepicker": "^0.1.38",
27 27
     "echarts": "^3.8.5",
28
+    "http-proxy-middleware": "^1",
28 29
     "jquery-datetimepicker": "^2.5.11",
29 30
     "minimatch": "^3.0.4"
30 31
   }