diff --git a/src/server/GoUtil/AliyunOpenApi.go b/src/server/GoUtil/AliyunOpenApi.go index 4df41753..faf5080f 100644 --- a/src/server/GoUtil/AliyunOpenApi.go +++ b/src/server/GoUtil/AliyunOpenApi.go @@ -29,8 +29,9 @@ func IdVerify(UserName, Num string) (_err error) { // 自动路由服务。 response, _err := Id2MetaVerifyAutoRoute(request) ret := util.ToJSONString(util.ToMap(response)) - console.Log(tea.String("最终结果(若此处为空,则所有服务点均异常,请逐步调试):" + tea.StringValue(ret))) - + if _err != nil { + console.Log(tea.String("最终结果(若此处为空,则所有服务点均异常,请逐步调试):" + tea.StringValue(ret))) + } return _err } @@ -54,8 +55,8 @@ func Id2MetaVerifyAutoRoute(request *sdk.Id2MetaVerifyRequest) (_result *sdk.Id2 return // 如果调用失败,继续下一个服务点。 } // 节点调用结果 - ret := util.ToJSONString(util.ToMap(response)) - console.Log(tea.String("节点 " + tea.StringValue(endpoint) + " 结果:" + tea.StringValue(ret) + " ")) + //ret := util.ToJSONString(util.ToMap(response)) + //console.Log(tea.String("节点 " + tea.StringValue(endpoint) + " 结果:" + tea.StringValue(ret) + " ")) // 有一个服务调用成功即返回。 lastResponse = response if !tea.BoolValue(util.IsUnset(response)) && tea.BoolValue(util.EqualNumber(tea.ToInt(response.StatusCode), tea.Int(200))) { diff --git a/src/server/MergeConst/ErrorCode.go b/src/server/MergeConst/ErrorCode.go index c994579e..b43e4ace 100644 --- a/src/server/MergeConst/ErrorCode.go +++ b/src/server/MergeConst/ErrorCode.go @@ -3,17 +3,18 @@ package MergeConst type ProtocolType int32 const ( - Protocol_Error_Account_Exist int32 = 100 - Protocol_Error_Account_OR_PWD_ERROR int32 = 101 - Protocol_Error_Account_OR_PWD_Short int32 = 102 - Protocol_Error_Account_Fail int32 = 103 - Protocol_Error_Account_NoExsit int32 = 104 - Protocol_Error_Account_Code_Error int32 = 105 - Protocol_Error_Account_Device_Error int32 = 106 - Protocol_Error_Id_Not_Verify int32 = 107 - Protocol_Error_Id_Verify_Error int32 = 108 - Protocol_Res_Buy_Cnt_Limit int32 = 110 - Protocol_Res_Buy_CD int32 = 111 + Protocol_Error_Account_Exist int32 = 100 + Protocol_Error_Account_OR_PWD_ERROR int32 = 101 + Protocol_Error_Account_OR_PWD_Short int32 = 102 + Protocol_Error_Account_Fail int32 = 103 + Protocol_Error_Account_NoExsit int32 = 104 + Protocol_Error_Account_Code_Error int32 = 105 + Protocol_Error_Account_Device_Error int32 = 106 + Protocol_Error_Id_Not_Verify int32 = 107 + Protocol_Error_Id_Verify_Error int32 = 108 + Protocol_Res_Buy_Cnt_Limit int32 = 110 + Protocol_Res_Buy_CD int32 = 111 + Protocol_Email_Find_Fail int32 = 120 Protocol_Active_No_Exsit int32 = 130 Protocol_Active_7Day_Rewarded int32 = 131 diff --git a/src/server/game/GameLogic.go b/src/server/game/GameLogic.go index 2aae940a..95e82051 100644 --- a/src/server/game/GameLogic.go +++ b/src/server/game/GameLogic.go @@ -930,7 +930,7 @@ func GeneratedCode(Phone string) (string, error) { if value != "" { //return fmt.Errorf("验证码已发送,请稍后再试") } - db.RedisSetKey(key, Code, time.Minute) + db.RedisSetKey(key, Code, 5*time.Minute) err := GoUtil.SmsCode(Phone, Code) if err != nil { log.Error("发送验证码失败: %v", err) @@ -943,11 +943,11 @@ func VerifyCode(Phone, Code string) error { key := "Code_" + Phone value, err := db.RedisGetKey(key) if err != nil { - return fmt.Errorf("获取验证码失败: %v", err) + return fmt.Errorf("验证码已失效") } if value == Code { db.RedisDelKey(key) return nil } - return fmt.Errorf("获取验证码失败: 不一致") + return fmt.Errorf("验证码错误") } diff --git a/src/server/msg/Gameapi.pb.go b/src/server/msg/Gameapi.pb.go index 5a2258f3..a6fb7d05 100644 --- a/src/server/msg/Gameapi.pb.go +++ b/src/server/msg/Gameapi.pb.go @@ -2095,6 +2095,7 @@ type ResLogin struct { DwUin int64 `protobuf:"varint,2,opt,name=dwUin,proto3" json:"dwUin,omitempty"` UserName string `protobuf:"bytes,3,opt,name=UserName,proto3" json:"UserName,omitempty"` FaceBookId string `protobuf:"bytes,4,opt,name=FaceBookId,proto3" json:"FaceBookId,omitempty"` + Msg string `protobuf:"bytes,5,opt,name=Msg,proto3" json:"Msg,omitempty"` // 错误信息 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2157,6 +2158,13 @@ func (x *ResLogin) GetFaceBookId() string { return "" } +func (x *ResLogin) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + type ReqChangePassword struct { state protoimpl.MessageState `protogen:"open.v1"` UserName string `protobuf:"bytes,1,opt,name=UserName,proto3" json:"UserName,omitempty"` @@ -23432,7 +23440,7 @@ const file_proto_Gameapi_proto_rawDesc = "" + "\n" + "ResultCode\x18\x01 \x01(\x0e2\x12.tutorial.RES_CODER\n" + "ResultCode\x12\x10\n" + - "\x03Msg\x18\x02 \x01(\tR\x03Msg\"|\n" + + "\x03Msg\x18\x02 \x01(\tR\x03Msg\"\x8e\x01\n" + "\bResLogin\x12\x1e\n" + "\n" + "ResultCode\x18\x01 \x01(\x05R\n" + @@ -23441,7 +23449,8 @@ const file_proto_Gameapi_proto_rawDesc = "" + "\bUserName\x18\x03 \x01(\tR\bUserName\x12\x1e\n" + "\n" + "FaceBookId\x18\x04 \x01(\tR\n" + - "FaceBookId\"_\n" + + "FaceBookId\x12\x10\n" + + "\x03Msg\x18\x05 \x01(\tR\x03Msg\"_\n" + "\x11ReqChangePassword\x12\x1a\n" + "\bUserName\x18\x01 \x01(\tR\bUserName\x12\x16\n" + "\x06OldPwd\x18\x02 \x01(\tR\x06OldPwd\x12\x16\n" +