| | |
| | | package com.doumee.api.web; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.Jwt.JwtProperties; |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | |
| | | @Resource |
| | | private MemberService memberService; |
| | | @Resource |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | |
| | | @ApiOperation("获取企业微信JS签名") |
| | | @PostMapping("/getQwSignature") |
| | | @ResponseBody |
| | | public ApiResponse<Object> getQwSignature(@RequestBody String url) { |
| | | |
| | | /* Map jsapiTicket = s; |
| | | String ticket = jsapiTicket.get("ticket").toString(); |
| | | public ApiResponse<Object> getQwSignature(@RequestBody Map<String,String> url) { |
| | | String jsapiTicket = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_JS_API_TICKET).getCode(); |
| | | String noncestr = UUID.randomUUID().toString(); |
| | | Long timestamp = System.currentTimeMillis() / 1000; |
| | | |
| | | String jsapiTicketStr = ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | String jsapiTicketStr = jsapiTicket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | try { |
| | | MessageDigest instance = MessageDigest.getInstance("SHA-1"); |
| | | instance.update(jsapiTicketStr.getBytes()); |
| | |
| | | String string = bigInteger.toString(); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("noncestr", noncestr); |
| | | result.put("jsapi_ticket", string); |
| | | result.put("signature", string); |
| | | result.put("timestamp", timestamp); |
| | | result.put("url", url); |
| | | result.put("ticket", ticket); |
| | | // result.put("ticket", jsapiTicket); |
| | | return ApiResponse.success( result); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | throw new RuntimeException(e); |
| | | }*/ |
| | | } |
| | | return ApiResponse.failed( "获取签名失败"); |
| | | } |
| | | } |