标签:string cas turn autowire moc cto framework title 菜单
※注解@CrossOrigin解决跨域问题:Spring Framework 4.2 GA为CORS提供了第一类支持,使您比通常的基于过滤器的解决方案更容易和更强大地配置它。所以springMVC的版本要在4.2或以上版本才支持@CrossOrigin
?参考链接:https://www.cnblogs.com/mmzs/p/9167743.html
package cn.itcast.haoke.dubbo.api.controller;
import cn.itcast.haoke.dubbo.api.config.MockConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RequestMapping("mock")
@RestController
@CrossOrigin
public class MockController {
@Autowired
private MockConfig mockConfig;
/*菜单*/
@GetMapping("index/menu")
public String indexMenu() {
return this.mockConfig.getIndexMenu();
}
/*首页资讯*/
@GetMapping("index/info")
public String indexInfo() {
return this.mockConfig.getIndexInfo();
}
/**
* * 首页问答
* * @return
*
*/
@GetMapping("index/faq")
public String indexFaq() {
return this.mockConfig.getIndexFaq();
}
}
标签:string cas turn autowire moc cto framework title 菜单
原文地址:https://www.cnblogs.com/zhuo-zui/p/12205179.html