修改参数
This commit is contained in:
@ -3,7 +3,10 @@ package com.stdiet.web.controller.custom;
|
|||||||
import com.stdiet.common.core.controller.BaseController;
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
import com.stdiet.custom.service.ISysWxService;
|
import com.stdiet.custom.service.ISysWxService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/wx")
|
@RequestMapping("/wx")
|
||||||
@ -13,8 +16,8 @@ public class CusWxController extends BaseController {
|
|||||||
public ISysWxService sysWxService;
|
public ISysWxService sysWxService;
|
||||||
|
|
||||||
@GetMapping("/checkSign")
|
@GetMapping("/checkSign")
|
||||||
public boolean wxCheckAuth(@RequestParam String signature, @RequestParam String timestamp, @RequestParam String nonce) {
|
public String wxCheckAuth(@RequestParam String signature, @RequestParam String timestamp, @RequestParam String nonce, @RequestParam String echostr) {
|
||||||
return sysWxService.wxCheckAuth(signature, timestamp, nonce);
|
return sysWxService.wxCheckAuth(signature, timestamp, nonce, echostr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,5 @@ public interface ISysWxService {
|
|||||||
* @param nonce
|
* @param nonce
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean wxCheckAuth(String signature, String timestamp, String nonce);
|
public String wxCheckAuth(String signature, String timestamp, String nonce, String echostr);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class SysWxServiceImpl implements ISysWxService {
|
public class SysWxServiceImpl implements ISysWxService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean wxCheckAuth(String signature, String timestamp, String nonce) {
|
public String wxCheckAuth(String signature, String timestamp, String nonce, String echostr) {
|
||||||
return WxTokenUtils.checkSignature(signature, timestamp, nonce);
|
return WxTokenUtils.checkSignature(signature, timestamp, nonce) ? echostr : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user