关于接口报文的加解密。get请求怎么传数据

Blade 未结 2 1126
xMan
xMan 剑者 2021-02-18 09:56

一、该问题的重现步骤是什么?

1. 

使用@ApiEncryptDes对接口进行加解密处理,
/**
 * 分页
 */
@GetMapping("/list")
@ApiImplicitParams({
   @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
   @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
})
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入notice")
@ApiEncryptDes
public R<IPage<NoticeVO>> list(@ApiIgnore @RequestParam Map<String, Object> notice, Query query) {
   IPage<Notice> pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class));
   return R.data(NoticeWrapper.build().pageVO(pages));
}

2. 然后前端传入加密后的参数,

data=mgpTTXIW55pG2GqcyHTruINSZI7VDhsm

3.打断点调试,发现data注入到了notice里


二、你期待的结果是什么?实际看到的又是什么?

前端需要怎么传数据,保证后台的参数能正确的注入


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

商业版Blade-boot版本,win7


四、请提供详细的错误堆栈信息,这很重要。

{

    "code"500,

    "success"false,

    "data": {},

    "msg""\r\n### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Unknown column 'data' in 'where clause'\r\n### The error may exist in org/springblade/modules/desk/mapper/NoticeMapper.java (best guess)\r\n### The error may involve defaultParameterMap\r\n### The error occurred while setting parameters\r\n### SQL: SELECT COUNT(*) FROM blade_notice WHERE is_deleted = 0 AND (data LIKE ?)\r\n### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'data' in 'where clause'\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'data' in 'where clause'"

}





五、若有更多详细信息,请在下面提供。


2条回答
  • 看下这章的文档,有例子。

    55YHD}RJ42]]}I$3V0@3NUM.png

    0 讨论(1)
  • 2021-02-18 16:22

    不知道为啥,群一直加不进去。现在只有2.4.0版本的文档啊。。求通过2569960992

    0 讨论(0)
提交回复