微信公衆號開發--微信JS-SDK掃一掃功能(三)

使用掃一掃功能controller調用:
	@RequestMapping(value="/config",method = RequestMethod.POST)
	@ResponseBody
	public Map  getConfig(HttpServletRequest request,@Value("${wx.appid}")String appid,@Value("${wx.secret}")String secret,HttpServletResponse resp){
		String retUrl = request.getHeader("Referer"); 
		Map map = Sign.sign( retUrl ,appid,secret);
		map.put("appId", appid);
		boolean checkSignature = SignUtil.checkSignature((String)map.get("signature"), (String)map.get("timestamp"), (String)map.get("nonceStr"));
		return map;
	}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章