任何浏览器都提示下载
为什么浏览器访问json后台java使用了@RestController提示下载文件,postman可以正常访问
求指点
@RestController
@RequestMapping("notice")
public class NoticeController {
@Autowired
MsgService msgService;
/**
* 查询当前用户 通知列表
*
* @param msg msg.userUid 为必填项
* @param page
* @return
*/
@RequestMapping(method = RequestMethod.GET)
public ApiResult listNotice(MsgBase msg, MsgPage page) {
if (StringUtils.isEmpty(msg.getUserUid())) {
return new ApiResult(401, "fail", 3001, "unauthorized");
}
try {
page = msgService.queryPageForNotice(msg, page);
long unreadTotal = msgService.listUnReadMsgByUserUid(msg.getUserUid());
page.setUnreadTotal(unreadTotal);
return ApiResult.success(page);
} catch (Exception e) {
e.printStackTrace();
return ApiResult.sysError();
}
}