test:测试addResourceHandlers

This commit is contained in:
曾文豪
2023-05-18 15:05:14 +08:00
parent 66ac435278
commit 815e172e02
59 changed files with 236 additions and 38 deletions

View File

@@ -0,0 +1,15 @@
package com.tiesheng.demo.config;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
public class DemoWebMvcConfigurer implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/mobile/**").addResourceLocations("classpath:/mobile/0.0.13/");
}
}

View File

@@ -1,19 +0,0 @@
package com.tiesheng.demo.controller;
import com.tiesheng.annotation.token.TokenIgnore;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
/**
* @author hao
*/
@Controller
public class RedirectController {
@GetMapping("/return")
@TokenIgnore
public String redirect() {
return "mobile/0.0.13/index.html";
}
}