Metrics
0
Watch 2.6k Star 5.3k Fork 2.6k

ThinkGem / JeeSite 4.xJavaAGPL-3.0

jeesite自定义api 无法访问

Open
pp  Created at

该问题是怎么引起的?

自定义包 和Controller,jeesite启动后访问自定义接口提示404,无法进入断点
spring-mvc.xml做了如下更改

base-package="com.thinkgem.jeesite,com.yxy"
加入命名空间为com.yxy
控制器

@Controller
@RequestMapping(value = "/api/yxy")
public class TestController extends BaseController {

@RequestMapping(value = "/getUser",method = RequestMethod.GET)
@ResponseBody
public Map getUser(HttpServletRequest request, HttpServletResponse response) {
    try {
        String token = request.getParameter("token");
        if (StringUtils.isNotEmpty(token))
            return null;
        Map user = UserUtils.getUserByToken(token);
        return user;
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    return null;
}

}

重现步骤

报错信息

访问http://localhost:8400/cloud-agreement/api/yxy/getUser提示404
输入图片说明

total 1 participants

Comments (0)

Sign in and comment

Assignee
Labels
Not set
Project
Milestone
Branch
Scheduled start
Not set
Scheduled end
Not set
Top level
Priority

Help Search