Commit 14fe0b1a80bb1fdcf12d649974118242de396fc4

Authored by YunaiV
1 parent d50fa8ed

1. 增加 druid

2. 增加 skywalking
ruoyi-common/src/main/resources/application-druid.yml
@@ -13,9 +13,9 @@ spring: @@ -13,9 +13,9 @@ spring:
13 slave: 13 slave:
14 # 从数据源开关/默认关闭 14 # 从数据源开关/默认关闭
15 enabled: false 15 enabled: false
16 - url:  
17 - username:  
18 - password: 16 + url:
  17 + username:
  18 + password:
19 # 初始连接数 19 # 初始连接数
20 initialSize: 5 20 initialSize: 5
21 # 最小连接池数量 21 # 最小连接池数量
@@ -35,23 +35,3 @@ spring: @@ -35,23 +35,3 @@ spring:
35 testWhileIdle: true 35 testWhileIdle: true
36 testOnBorrow: false 36 testOnBorrow: false
37 testOnReturn: false 37 testOnReturn: false
38 - webStatFilter:  
39 - enabled: true  
40 - statViewServlet:  
41 - enabled: true  
42 - # 设置白名单,不填则允许所有访问  
43 - allow:  
44 - url-pattern: /druid/*  
45 - # 控制台管理用户名和密码  
46 - login-username:  
47 - login-password:  
48 - filter:  
49 - stat:  
50 - enabled: true  
51 - # 慢SQL记录  
52 - log-slow-sql: true  
53 - slow-sql-millis: 1000  
54 - merge-sql: true  
55 - wall:  
56 - config:  
57 - multi-statement-allow: true  
58 \ No newline at end of file 38 \ No newline at end of file
ruoyi-ui/src/components/RuoYi/Git/index.vue
@@ -9,7 +9,7 @@ export default { @@ -9,7 +9,7 @@ export default {
9 name: 'YudaoGit', 9 name: 'YudaoGit',
10 data() { 10 data() {
11 return { 11 return {
12 - url: 'https://github.com/YunaiV/ruoyi-vue-proe' 12 + url: 'https://github.com/YunaiV/ruoyi-vue-pro'
13 } 13 }
14 }, 14 },
15 methods: { 15 methods: {
ruoyi-ui/src/views/infra/server/index.vue
@@ -18,7 +18,7 @@ export default { @@ -18,7 +18,7 @@ export default {
18 18
19 setTimeout(() => { 19 setTimeout(() => {
20 // 模拟点击【应用】菜单 20 // 模拟点击【应用】菜单
21 - that.$refs["iframe"].contentWindow.document.getElementsByClassName('navbar-item')[2].click(); 21 + // that.$refs["iframe"].contentWindow.document.getElementsByClassName('navbar-item')[2].click(); // TODO 暂时去掉,存在跨域问题
22 // 取消加载中 22 // 取消加载中
23 this.loading = false; 23 this.loading = false;
24 }, 230); 24 }, 230);
ruoyi-ui/src/views/infra/skywalking/index.vue 0 → 100644
  1 +<template>
  2 + <div v-loading="loading" :style="'height:'+ height">
  3 + <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
  4 + </div>
  5 +</template>
  6 +<script>
  7 +export default {
  8 + name: "SkyWalking",
  9 + data() {
  10 + return {
  11 + src: "http://skywalking.shop.iocoder.cn", // TODO 芋艿,后续改成配置读取
  12 + height: document.documentElement.clientHeight - 94.5 + "px;",
  13 + loading: true
  14 + };
  15 + },
  16 + mounted: function() {
  17 + setTimeout(() => {
  18 + this.loading = false;
  19 + }, 230);
  20 + const that = this;
  21 + window.onresize = function temp() {
  22 + that.height = document.documentElement.clientHeight - 94.5 + "px;";
  23 + };
  24 + }
  25 +};
  26 +</script>
src/main/java/cn/iocoder/dashboard/framework/security/config/SecurityConfiguration.java
@@ -123,32 +123,31 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @@ -123,32 +123,31 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
123 // 一堆自定义的 Spring Security 处理器 123 // 一堆自定义的 Spring Security 处理器
124 .exceptionHandling().authenticationEntryPoint(unauthorizedHandler) 124 .exceptionHandling().authenticationEntryPoint(unauthorizedHandler)
125 .accessDeniedHandler(accessDeniedHandler).and() 125 .accessDeniedHandler(accessDeniedHandler).and()
126 - // TODO 过滤请求 126 + // 设置每个请求的权限
127 .authorizeRequests() 127 .authorizeRequests()
128 - // 登陆的接口,可匿名访问  
129 - .antMatchers(webProperties.getApiPrefix() + "/login").anonymous()  
130 - // 通用的接口,可匿名访问  
131 - .antMatchers( webProperties.getApiPrefix() + "/system/captcha/**").anonymous()  
132 - // TODO  
133 - .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()  
134 - .antMatchers("/profile/**").anonymous()  
135 - // 文件的获取接口,可匿名访问  
136 - .antMatchers(webProperties.getApiPrefix() + "/system/file/get/**").anonymous()  
137 - // TODO  
138 - .antMatchers("/swagger-ui.html").anonymous()  
139 - .antMatchers("/swagger-resources/**").anonymous()  
140 - .antMatchers("/webjars/**").anonymous()  
141 - .antMatchers("/*/api-docs").anonymous()  
142 - // Spring Boot Admin Server 的安全配置  
143 - .antMatchers(adminServerProperties.getContextPath()).anonymous()  
144 - .antMatchers(adminServerProperties.getContextPath() + "/**").anonymous()  
145 - // Spring Boot Actuator 的安全配置  
146 - .antMatchers("/actuator").anonymous()  
147 - .antMatchers("/actuator/**").anonymous()  
148 - // TODO  
149 - .antMatchers("/druid/**").hasAnyAuthority("druid") // TODO 芋艿,未来需要在拓展下  
150 - // 除上面外的所有请求全部需要鉴权认证  
151 - .anyRequest().authenticated() 128 + // 登陆的接口,可匿名访问
  129 + .antMatchers(webProperties.getApiPrefix() + "/login").anonymous()
  130 + // 通用的接口,可匿名访问
  131 + .antMatchers( webProperties.getApiPrefix() + "/system/captcha/**").anonymous()
  132 + // 静态资源,可匿名访问
  133 + .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
  134 + // 文件的获取接口,可匿名访问
  135 + .antMatchers(webProperties.getApiPrefix() + "/system/file/get/**").anonymous()
  136 + // Swagger 接口文档
  137 + .antMatchers("/swagger-ui.html").anonymous()
  138 + .antMatchers("/swagger-resources/**").anonymous()
  139 + .antMatchers("/webjars/**").anonymous()
  140 + .antMatchers("/*/api-docs").anonymous()
  141 + // Spring Boot Admin Server 的安全配置
  142 + .antMatchers(adminServerProperties.getContextPath()).anonymous()
  143 + .antMatchers(adminServerProperties.getContextPath() + "/**").anonymous()
  144 + // Spring Boot Actuator 的安全配置
  145 + .antMatchers("/actuator").anonymous()
  146 + .antMatchers("/actuator/**").anonymous()
  147 + // Druid 监控
  148 + .antMatchers("/druid/**").anonymous()
  149 + // 除上面外的所有请求全部需要鉴权认证
  150 + .anyRequest().authenticated()
152 .and() 151 .and()
153 .headers().frameOptions().disable(); 152 .headers().frameOptions().disable();
154 httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); 153 httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
src/main/resources/application-local.yaml
@@ -11,6 +11,27 @@ spring: @@ -11,6 +11,27 @@ spring:
11 driver-class-name: com.mysql.jdbc.Driver 11 driver-class-name: com.mysql.jdbc.Driver
12 username: root 12 username: root
13 password: 123456 13 password: 123456
  14 + druid:
  15 + web-stat-filter:
  16 + enabled: true
  17 + stat-view-servlet:
  18 + enabled: true
  19 + # 设置白名单,不填则允许所有访问
  20 + allow:
  21 + url-pattern: /druid/*
  22 + # 控制台管理用户名和密码
  23 + login-username:
  24 + login-password:
  25 + filter:
  26 + stat:
  27 + enabled: true
  28 + # 慢 SQL 记录
  29 + log-slow-sql: true
  30 + slow-sql-millis: 100
  31 + merge-sql: true
  32 + wall:
  33 + config:
  34 + multi-statement-allow: true
14 35
15 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 36 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
16 redis: 37 redis: