Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

spring-boot-demo-rbac-security 登陆时 400,请问要怎么解决呀? #209

Answered by icyfang
jhnlynn asked this question in Q&A
Discussion options

application.yml:

server:
 port: 8080
 servlet:
 context-path: /demo

使用 Intellij idea 自动生成的 generated-request.http,通过POST 请求访问 端点后,返回的 code 为 400 ,如下:

###
POST http://localhost:8080/demo/api/auth/login?usernameOrEmailOrPhone=admin&password=123456
<> 2021年07月10日T131209.200.json
<> 2021年07月10日T125242.200.json
{
 "code": 400,
 "message": "参数不能为空!",
 "data": null
}

且没有进入 AuthControllerlogin 方法的断点。
求问:是什么原因呀?

You must be logged in to vote

参数放body,而不是param

Replies: 2 comments 1 reply

Comment options

参数放body,而不是param

You must be logged in to vote
1 reply
Comment options

嗯嗯, 明白了! 谢谢!

Answer selected by jhnlynn
Comment options

400 错误基本都是参数请求格式错误

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /