diff --git a/build/webpack.dll.conf.js b/build/webpack.dll.conf.js index dae8bd32..a16547be 100644 --- a/build/webpack.dll.conf.js +++ b/build/webpack.dll.conf.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); const path = require('path'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin') +const config = require('../config') const vendors = [ 'vue/dist/vue.esm.js', @@ -23,6 +24,9 @@ module.exports = { library: '[name]_dll', }, plugins: [ + new webpack.DefinePlugin({ + 'process.env': config.build.env + }), new webpack.optimize.ModuleConcatenationPlugin(), new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /zh-cn/), new UglifyJSPlugin({ diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 3722f599..572ec5a4 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -108,6 +108,10 @@ http { proxy_pass http://oj-backend:8080; } + location /admin { + root /OJ_FE/dist/admin; + try_files $uri $uri/ /index.html; + } location / { root /OJ_FE/dist; try_files $uri $uri/ /index.html; diff --git a/src/pages/admin/App.vue b/src/pages/admin/App.vue index 57e24c75..8eaf8de1 100644 --- a/src/pages/admin/App.vue +++ b/src/pages/admin/App.vue @@ -12,18 +12,6 @@