Browse Source

初始化项目

hanwenjie 1 year ago
parent
commit
c1479e80e5

+ 3 - 1
rouyi-api/src/main/java/com/info666/infraredRemote/controller/InitController.java

@@ -6,9 +6,11 @@ import com.ruoyi.system.dto.output.GetCodeOutput;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-@RestController("/init")
+@RestController
+@RequestMapping("/api/v1/init")
 public class InitController {
 
     @ApiOperation("测试接口")

+ 1 - 1
rouyi-api/src/main/resources/application.yml

@@ -119,7 +119,7 @@ swagger:
   # 是否开启swagger
   enabled: true
   # 请求前缀
-  pathMapping: /dev-api
+  pathMapping:
 
 # 防止XSS攻击
 xss:

+ 2 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -112,6 +112,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                 .antMatchers("/login", "/register", "/captchaImage").permitAll()
+                // api暂时开放访问
+                .antMatchers("/api/**").permitAll()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()