From 41ca4e938d63027931447ebe343f47366194cac2 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Mon, 19 Apr 2021 11:04:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E5=90=8E?= =?UTF-8?q?=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/conf/security/WebSecurityConfig.java | 6 +++--- web_src/build/webpack.dev.conf.js | 4 ++-- web_src/build/webpack.prod.conf.js | 6 +++--- web_src/config/index.js | 2 +- web_src/index.html | 8 +++---- web_src/src/App.vue | 2 ++ web_src/src/main.js | 21 ++++++++++--------- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java index 1de14e63..ebeefd45 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java @@ -69,9 +69,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { // 可以直接访问的静态数据 web.ignoring() .antMatchers("/") - .antMatchers("/css/**") - .antMatchers("/img/**") - .antMatchers("/fonts/**") + .antMatchers("/static/**") .antMatchers("/index.html") .antMatchers("/doc.html") // "/webjars/**", "/swagger-resources/**", "/v3/api-docs/**" .antMatchers("/webjars/**") @@ -100,6 +98,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.cors().and().csrf().disable(); + // 设置允许添加静态文件 + http.headers().contentTypeOptions().disable(); http.authorizeRequests() // 放行接口 .antMatchers("/api/user/login","/index/hook/**").permitAll() diff --git a/web_src/build/webpack.dev.conf.js b/web_src/build/webpack.dev.conf.js index e33cb017..58c54575 100755 --- a/web_src/build/webpack.dev.conf.js +++ b/web_src/build/webpack.dev.conf.js @@ -64,8 +64,8 @@ const devWebpackConfig = merge(baseWebpackConfig, { to: config.dev.assetsSubDirectory, ignore: ['.*'] }, - { from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm'}, - { from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'js/'} + { from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm', to: 'static/'}, + { from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'static/js/'} ]) ] }) diff --git a/web_src/build/webpack.prod.conf.js b/web_src/build/webpack.prod.conf.js index 13d373db..61e63e94 100644 --- a/web_src/build/webpack.prod.conf.js +++ b/web_src/build/webpack.prod.conf.js @@ -46,7 +46,7 @@ const webpackConfig = merge(baseWebpackConfig, { filename: utils.assetsPath('css/[name].[contenthash].css'), // Setting the following option to `false` will not extract CSS from codesplit chunks. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. - // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 allChunks: true, }), @@ -115,8 +115,8 @@ const webpackConfig = merge(baseWebpackConfig, { to: config.build.assetsSubDirectory, ignore: ['.*'] }, - { from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm'}, - { from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'js/'} + { from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm', to: 'static/'}, + { from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'static/js/'} ]) ] }) diff --git a/web_src/config/index.js b/web_src/config/index.js index e6c0f6c9..5ab5eacb 100644 --- a/web_src/config/index.js +++ b/web_src/config/index.js @@ -51,7 +51,7 @@ module.exports = { // Paths assetsRoot: path.resolve(__dirname, '../../src/main/resources/static/'), - assetsSubDirectory: '.', + assetsSubDirectory: './static', assetsPublicPath: '/', /** diff --git a/web_src/index.html b/web_src/index.html index 6c469371..88791758 100644 --- a/web_src/index.html +++ b/web_src/index.html @@ -4,12 +4,12 @@