wfz il y a 2 ans
Parent
commit
3c8466bab8
4 fichiers modifiés avec 9 ajouts et 8 suppressions
  1. 1 1
      api/wx/wx.pb.go
  2. 1 1
      api/wx/wx.proto
  3. 6 3
      api/wx/wx_http.pb.go
  4. 1 3
      js/api/wx/wx_http_pb.ts

+ 1 - 1
api/wx/wx.pb.go

@@ -526,7 +526,7 @@ var file_wx_proto_rawDesc = []byte{
 	0x2e, 0x77, 0x78, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
 	0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02,
-	0x19, 0x12, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2f, 0x73, 0x75, 0x62,
+	0x19, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2f, 0x73, 0x75, 0x62,
 	0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x77, 0x65, 0x62, 0x42, 0x37, 0x0a, 0x06, 0x61, 0x70,
 	0x69, 0x2e, 0x77, 0x78, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62,
 	0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77,

+ 1 - 1
api/wx/wx.proto

@@ -48,7 +48,7 @@ service Wx {
   };
   rpc SendNewVisitorReminder (OpenIDRequest) returns (google.protobuf.Empty){
     option (google.api.http) = {
-      get: "/api/send/subscribe/web",
+      post: "/api/send/subscribe/web",
     };
   };
 }

+ 6 - 3
api/wx/wx_http.pb.go

@@ -40,7 +40,7 @@ func RegisterWxHTTPServer(s *http.Server, srv WxHTTPServer) {
 	r.POST("/api/wx/jssdk/config", _Wx_WxConf0_HTTP_Handler(srv))
 	r.POST("/api/common/material/upload/voice", _Wx_UploadMaterialVoice0_HTTP_Handler(srv))
 	r.GET("/api/get_access_token", _Wx_GetAccessToken0_HTTP_Handler(srv))
-	r.GET("/api/send/subscribe/web", _Wx_SendNewVisitorReminder0_HTTP_Handler(srv))
+	r.POST("/api/send/subscribe/web", _Wx_SendNewVisitorReminder0_HTTP_Handler(srv))
 }
 
 func _Wx_WxConf0_HTTP_Handler(srv WxHTTPServer) func(ctx http.Context) error {
@@ -124,6 +124,9 @@ func _Wx_GetAccessToken0_HTTP_Handler(srv WxHTTPServer) func(ctx http.Context) e
 func _Wx_SendNewVisitorReminder0_HTTP_Handler(srv WxHTTPServer) func(ctx http.Context) error {
 	return func(ctx http.Context) error {
 		var in OpenIDRequest
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
 		if err := ctx.BindQuery(&in); err != nil {
 			return err
 		}
@@ -176,10 +179,10 @@ func (c *WxHTTPClientImpl) GetAccessToken(ctx context.Context, in *GetAccessToke
 func (c *WxHTTPClientImpl) SendNewVisitorReminder(ctx context.Context, in *OpenIDRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
 	var out emptypb.Empty
 	pattern := "/api/send/subscribe/web"
-	path := binding.EncodeURL(pattern, in, true)
+	path := binding.EncodeURL(pattern, in, false)
 	opts = append(opts, http.Operation("/api.wx.Wx/SendNewVisitorReminder"))
 	opts = append(opts, http.PathTemplate(pattern))
-	err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
+	err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
 	if err != nil {
 		return nil, err
 	}

+ 1 - 3
js/api/wx/wx_http_pb.ts

@@ -22,9 +22,7 @@ const WxService = {
     return res.data.data;
   },
   SendNewVisitorReminder: async (req?: OpenIDRequest) => {
-	const res = await request.get('/api/send/subscribe/web', {
-		params: req
-	});
+	const res = await request.post('/api/send/subscribe/web', req);
     return res.data.data;
   },