-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
"message": "unauthorized" #146
Comments
刚才简单读了下代码,结合我残缺的记忆,好像 是因为现在并没有实质上的账号密码的逻辑,所以会报错。 目前应该只能通过 |
我把那个登录逻辑写成死的账号密码了,在mysql的employee里面加了条数据,这样做应该可以返回token了吧,是不是还需要把前端的自我销毁的按钮的disabled拿掉,然后在项目里面docker build了一下,docker compose up -d了一下,有单独搞了个docker-compose.yml,里面写了version: "3" services: |
我理解你这边的诉求是 API 鉴权是吗?可以考虑直接用 |
func authenticator(c *gin.Context) (interface{}, error) {
var body user.User
if err := c.ShouldBind(&body); err != nil {
return "", jwt.ErrMissingLoginValues
}
// TODO login authenticator
return nil, jwt.ErrFailedAuthentication
} 请问这一行的代码有进行修改吗?目前 main branch 中登录逻辑是未实现的状态。 我理解需要登录的话,这里需要进行更改。 |
没有修改,因为改完之后,我不知道怎么用本地的镜像去部署,前几天折腾了一下,后端容器状态是unhealthy不能用 |
@wick233 如果需求是“需要账号密码才能调用 API”,建议直接考虑用 nginx 实现 |
我的需求是可以创建永久的文档,可以关闭自我销毁按钮 |
我在pasteme这个表里面加了个账号,然后post请求/api/v3/token,body里面传了{
"username": "[email protected]",
"password": "123456",
}为什么报错账号或密码错误{
"code": 401,
"message": "incorrect Username or Password"
}
The text was updated successfully, but these errors were encountered: