java微信小程序中获取access_token
AccessTokenUtil .java
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
@Component
public class AccessTokenUtil {
@Autowired
private RedisTemplate redisTemplate;
// 小程序唯一凭证,即 AppID
public static final String appId = "xxx";
// 小程序唯一凭证密钥,即 AppSecret
public static final String secret = "xxx";
/**
* 接口调用凭证 access_token
*
* @return
*/
public Str
上一篇:
uniapp开发微信小程序-2.页面制作
下一篇:
微信小程序--自定义下拉列表
