From c1905c1826c89545ccc9c5e066350640c16b9fa5 Mon Sep 17 00:00:00 2001 From: univero <1449610641@qq.com> Date: Mon, 25 Nov 2024 23:05:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E5=8F=91=E9=80=81=E6=88=90=E5=8A=9F=E6=88=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/platform/core_api/auth.pb.go | 40 ++++++++++++++----- biz/application/service/auth.go | 11 +++-- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/biz/application/dto/platform/core_api/auth.pb.go b/biz/application/dto/platform/core_api/auth.pb.go index b8a8796..2094e57 100644 --- a/biz/application/dto/platform/core_api/auth.pb.go +++ b/biz/application/dto/platform/core_api/auth.pb.go @@ -315,6 +315,9 @@ type SendVerifyCodeResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Code int64 `protobuf:"varint,1,opt,name=code,proto3" form:"code" json:"code" query:"code"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" form:"msg" json:"msg" query:"msg"` } func (x *SendVerifyCodeResp) Reset() { @@ -349,6 +352,20 @@ func (*SendVerifyCodeResp) Descriptor() ([]byte, []int) { return file_platform_core_api_auth_proto_rawDescGZIP(), []int{5} } +func (x *SendVerifyCodeResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *SendVerifyCodeResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + var File_platform_core_api_auth_proto protoreflect.FileDescriptor var file_platform_core_api_auth_proto_rawDesc = []byte{ @@ -385,17 +402,20 @@ var file_platform_core_api_auth_proto_rawDesc = []byte{ 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x42, 0x84, 0x01, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x68, 0x70, 0x6f, 0x6c, 0x61, 0x72, - 0x69, 0x73, 0x2e, 0x69, 0x64, 0x6c, 0x67, 0x65, 0x6e, 0x2e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x42, 0x09, 0x41, 0x75, 0x74, - 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x68, 0x2d, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2f, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2d, 0x61, 0x70, - 0x69, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x84, 0x01, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x68, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2e, 0x69, 0x64, 0x6c, 0x67, 0x65, 0x6e, 0x2e, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, + 0x69, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x68, 0x2d, 0x70, 0x6f, + 0x6c, 0x61, 0x72, 0x69, 0x73, 0x2f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x63, + 0x6f, 0x72, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/biz/application/service/auth.go b/biz/application/service/auth.go index 9fff631..62b0039 100644 --- a/biz/application/service/auth.go +++ b/biz/application/service/auth.go @@ -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 }