@GetMapping(value = "/test") public String test(@RequestParam(value = "id")Long id,Model model,HttpServletRequest request ) throws WxErrorException{ String url = request.getRequestURL().toString()+"?id="+id; WxJsapiSignature sign = wxMpService.createJsapiSignature(url); model.addAttribute("jsApi",JsonUtils.toJson(sign)); return "对应的页面"; }
最后说总结下思路,1下载文件,2后台获取签名(注意签名算法),3页面引入js调用接口。