Skip to content

Commit

Permalink
Merge pull request #13 from xh-polaris/feat/auth
Browse files Browse the repository at this point in the history
fix: 添加了验证码发送成功或失败的提示
  • Loading branch information
universero authored Nov 25, 2024
2 parents f1dd8bd + c1905c1 commit 691c4aa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
40 changes: 30 additions & 10 deletions biz/application/dto/platform/core_api/auth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions biz/application/service/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,19 @@ func (s *AuthService) SetPassword(ctx context.Context, req *core_api.SetPassword
}

func (s *AuthService) SendVerifyCode(ctx context.Context, req *core_api.SendVerifyCodeReq) (*core_api.SendVerifyCodeResp, error) {
resp := new(core_api.SendVerifyCodeResp)
_, err := s.Sts.SendVerifyCode(ctx, &sts.SendVerifyCodeReq{
AuthType: req.AuthType,
AuthId: req.AuthId,
})
if err != nil {
return nil, err
return &core_api.SendVerifyCodeResp{
Code: 1005,
Msg: "验证码发送失败,请重试",
}, nil
}

return resp, nil
return &core_api.SendVerifyCodeResp{
Code: 0,
Msg: "验证发送成功",
}, nil
}

0 comments on commit 691c4aa

Please sign in to comment.