Skip to content

API 请求鉴权提示优化 #4753

Closed
Listed in
Closed
@Clouder0

Description

@Clouder0

描述问题 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

Activity

self-assigned this
on May 1, 2022
added this to the 2.0.4 milestone on May 1, 2022
88250

88250 commented on May 2, 2022

@88250
Member

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

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

maoruibin commented on Nov 22, 2024

@maoruibin

@88250 你好,作者。

我使用 API 进行笔记发送时一直提示 401,但我检查我的 token 是对的,你可以看我截图,这里鉴权不通过还有什么原因吗,不会是因为没有开通会员吧,我看这个不是会员功能。

image

image

maoruibin

maoruibin commented on Nov 22, 2024

@maoruibin

我知道问题了,我的 token 错了,需要去链滴网址里找,而不是客户端中的那个值,话说客户端中那个 token 有什么用,是不是可以不显示了,或者放一个链滴 的跳转链接,否则还有人理解错了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@maoruibin@Clouder0

      Issue actions

        API 请求鉴权提示优化 · Issue #4753 · siyuan-note/siyuan