From 257525d18d25032d9b9665f4a0949c2737f1ff33 Mon Sep 17 00:00:00 2001 From: xpnas Date: Thu, 25 Mar 2021 22:36:45 +0800 Subject: [PATCH] =?UTF-8?q?docker=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inotify.Vue/Dockerfile | 2 +- Inotify.Vue/mock/user.js | 2 +- Inotify.Vue/vue.config.js | 2 +- Inotify/Startup.cs | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Inotify.Vue/Dockerfile b/Inotify.Vue/Dockerfile index 6b1750a..3b7c1eb 100644 --- a/Inotify.Vue/Dockerfile +++ b/Inotify.Vue/Dockerfile @@ -2,5 +2,5 @@ FROM nginx RUN mkdir /usr/share/nginx/dist RUN rm -rf /etc/nginx/nginx.conf COPY ./nginx.conf /etc/nginx/nginx.conf -COPY ./dist /usr/share/nginx/dist +COPY ../inotify/dist /usr/share/nginx/dist EXPOSE 9099 \ No newline at end of file diff --git a/Inotify.Vue/mock/user.js b/Inotify.Vue/mock/user.js index 972849f..79d131d 100644 --- a/Inotify.Vue/mock/user.js +++ b/Inotify.Vue/mock/user.js @@ -29,7 +29,7 @@ module.exports = [ url: '/oauth/login', type: 'post', response: config => { - const { username } = config.body + const { username } = config.params const token = tokens[username] // mock error diff --git a/Inotify.Vue/vue.config.js b/Inotify.Vue/vue.config.js index c3086e9..ea4dbd2 100644 --- a/Inotify.Vue/vue.config.js +++ b/Inotify.Vue/vue.config.js @@ -25,7 +25,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: '/', - outputDir: 'dist', + outputDir: '../Inotify/wwwroot', assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', productionSourceMap: false, diff --git a/Inotify/Startup.cs b/Inotify/Startup.cs index 4fc96b6..ba55de4 100644 --- a/Inotify/Startup.cs +++ b/Inotify/Startup.cs @@ -96,6 +96,10 @@ namespace Inotify public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { +#if !DEBUG + app.UseStaticFiles(); + app.UseFileServer(); +#endif if (env.IsDevelopment()) { app.UseDeveloperExceptionPage();