Commit c02dad2ca3830eafe476c7fa96724ec267cb82e5
1 parent
1bfa14e3
默认访问首页新增提示语
Showing
2 changed files
with
32 additions
and
2 deletions
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
0 → 100644
1 | +package com.ruoyi.web.controller.system; | |
2 | + | |
3 | +import org.springframework.beans.factory.annotation.Autowired; | |
4 | +import org.springframework.web.bind.annotation.RequestMapping; | |
5 | +import org.springframework.web.bind.annotation.RestController; | |
6 | +import com.ruoyi.common.config.RuoYiConfig; | |
7 | +import com.ruoyi.common.utils.StringUtils; | |
8 | + | |
9 | +/** | |
10 | + * 首页 | |
11 | + * | |
12 | + * @author ruoyi | |
13 | + */ | |
14 | +@RestController | |
15 | +public class SysIndexController | |
16 | +{ | |
17 | + /** 系统基础配置 */ | |
18 | + @Autowired | |
19 | + private RuoYiConfig ruoyiConfig; | |
20 | + | |
21 | + /** | |
22 | + * 访问首页,提示语 | |
23 | + */ | |
24 | + @RequestMapping("/") | |
25 | + public String index() | |
26 | + { | |
27 | + return StringUtils.format("欢迎使用RuoYi后台管理框架,当前版本:v{}", ruoyiConfig.getVersion()); | |
28 | + } | |
29 | +} | |
... | ... |
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
... | ... | @@ -100,12 +100,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter |
100 | 100 | .antMatchers("/login", "/captchaImage").anonymous() |
101 | 101 | .antMatchers( |
102 | 102 | HttpMethod.GET, |
103 | + "/", | |
103 | 104 | "/*.html", |
104 | 105 | "/**/*.html", |
105 | 106 | "/**/*.css", |
106 | - "/**/*.js" | |
107 | + "/**/*.js", | |
108 | + "/profile/**" | |
107 | 109 | ).permitAll() |
108 | - .antMatchers("/profile/**").anonymous() | |
109 | 110 | .antMatchers("/common/download**").anonymous() |
110 | 111 | .antMatchers("/common/download/resource**").anonymous() |
111 | 112 | .antMatchers("/swagger-ui.html").anonymous() |
... | ... |