feat(API): 修改文章ID类型为String并添加CORS配置
将文章ID从Integer类型改为String类型以支持更灵活的ID格式 添加CORS配置类解决跨域问题,允许所有来源访问API
This commit is contained in:
@@ -30,9 +30,8 @@ public class ArticleController {
|
||||
* @return 返回包含文章信息的ResponseMessage对象
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseMessage<Article> getArticle(@PathVariable Integer id) {
|
||||
public ResponseMessage<Article> getArticle(@PathVariable String id) {
|
||||
return articleService.getArticleById(id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user