diff --git a/nginx.conf b/nginx.conf index f6b2f0b5c..f05865b8d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,8 +1,8 @@ server { listen 80; - location / { - try_files $uri / /index.html; + location ^~ /ui/ { + try_files $uri / /ui/index.html; alias /opt/lina/; } } diff --git a/src/router/index.js b/src/router/index.js index 90146bb93..2f8e5e248 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -238,6 +238,7 @@ const createRouter = () => new Router({ // mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), mode: 'history', + base: '/ui/', routes: constantRoutes }) diff --git a/vue.config.js b/vue.config.js index 1069d9e50..ab3f37117 100644 --- a/vue.config.js +++ b/vue.config.js @@ -24,7 +24,7 @@ module.exports = { * In most cases please use '/' !!! * Detail: https://cli.vuejs.org/config/#publicpath */ - publicPath: '/', + publicPath: '/ui/', outputDir: 'dist', assetsDir: 'assets', lintOnSave: process.env.NODE_ENV === 'development',