Przeglądaj źródła

[接收微信回调][修改]

release_toaliyun_real
Stormeye Wu 7 lat temu
rodzic
commit
b4c3910d7a
1 zmienionych plików z 5 dodań i 11 usunięć
  1. +5
    -11
      mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java

+ 5
- 11
mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java Wyświetl plik

@@ -25,15 +25,10 @@ public class WechatCalllbackController extends BaseController {
protected WxOpenService wxOpenService; protected WxOpenService wxOpenService;


@RequestMapping("/notify") @RequestMapping("/notify")
public Object receiveTicket(HttpServletRequest request) throws IOException {
logger.info("[" +getIpAddr() + "]接收微信请求");
InputStream inStream = request.getInputStream();
byte[] buffer = new byte[1024];
int len = 0;
while ((len = inStream.read(buffer)) != -1) {
logger.debug(buffer.toString());
}
/*
public Object receiveTicket(@RequestBody(required = false) String requestBody, @RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce, @RequestParam("signature") String signature,
@RequestParam(name = "encrypt_type", required = false) String encType,
@RequestParam(name = "msg_signature", required = false) String msgSignature) {
logger.info( logger.info(
"\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}]," "\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
@@ -54,12 +49,11 @@ public class WechatCalllbackController extends BaseController {
} catch (WxErrorException e) { } catch (WxErrorException e) {
this.logger.error("notify", e); this.logger.error("notify", e);
} }
*/


return "success"; return "success";
} }


@RequestMapping("callback/{appId}")
@RequestMapping("/{appId}/callback")
public Object callback(@RequestBody(required = false) String requestBody, public Object callback(@RequestBody(required = false) String requestBody,
@PathVariable("appId") String appId, @PathVariable("appId") String appId,
@RequestParam("signature") String signature, @RequestParam("signature") String signature,


Ładowanie…
Anuluj
Zapisz