Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API 请求鉴权提示优化 #4753

Closed
Tracked by #2
Clouder0 opened this issue May 1, 2022 · 1 comment
Closed
Tracked by #2

API 请求鉴权提示优化 #4753

Clouder0 opened this issue May 1, 2022 · 1 comment
Assignees
Milestone

Comments

@Clouder0
Copy link
Member

Clouder0 commented May 1, 2022

描述问题 Describe the problem

目前调用 API 时,若未鉴权会返回整个鉴权 html 页面。

期待的结果 Expected result

希望可以返回 json,例如:

{
	"code": -1,
	"msg": "Authorization Failed.",
        "data": null

截图

Authorization Failed

Authorization Succeeded

版本环境 Version environment

  • Version: v2.0.3
@88250 88250 self-assigned this May 1, 2022
@88250 88250 added this to the 2.0.4 milestone May 1, 2022
@88250
Copy link
Member

88250 commented May 2, 2022

下个版本改进,鉴权不通过的话 HTTP 状态码 401,body:

{
    "code": -1,
    "msg": "Auth failed"
}

@88250 88250 closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants