Browse Source

删除多余代码

zh 3 years ago
parent
commit
6687aa4bd6

+ 2 - 4
boman-wechat/src/main/java/com/boman/wechat/service/impl/WxPushServiceImpl.java

@@ -3,7 +3,6 @@ package com.boman.wechat.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.StringUtils;
-import com.boman.domain.SysUser;
 import com.boman.domain.TemplateData;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.WxMsgDto;
@@ -17,7 +16,6 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -43,7 +41,7 @@ public class WxPushServiceImpl implements WxPushService {
         Map<String, Object> pushResult = new HashMap<>();
 
         //获取access_token
-        String accessToken = getAccessToken(properties.getAppId(), properties.getSecret());
+        String accessToken = getAccessToken();
         if(StringUtils.isEmpty(accessToken)) {
             pushResult.put("msg", "获取access_token失败");
             return pushResult;
@@ -93,7 +91,7 @@ public class WxPushServiceImpl implements WxPushService {
      * 获取access_token
      * appid和appsecret到小程序后台获取,当然也可以让小程序开发人员给你传过来
      * */
-    private String getAccessToken(String appid, String appsecret) {
+    private String getAccessToken() {
         //获取access_token
         String url = properties.getAccessTokenUrl() + "&appid=" + properties.getAppId() + "&secret=" + properties.getSecret();
         String json = restTemplate.getForObject(url, String.class);