记得上下班打卡 | git大法好,push需谨慎

Commit fc6b18a4 authored by jiangxiulong's avatar jiangxiulong

token test

parent 151b273e
......@@ -3,8 +3,12 @@ package com.liquidnet.service.sweet.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.annotation.PostConstruct;
......@@ -67,11 +71,17 @@ public class WechatMaConfigure {
private WxMaService wxMaAppletFiveService;
private WxMaService wxMaAppletMdskService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@PostConstruct
public void init() {
wxMaAppletZhengzaiService = new WxMaServiceImpl() {
{
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
RedisTemplateWxRedisOps redisTemplateWxRedisOps = new RedisTemplateWxRedisOps(stringRedisTemplate);
WxMaRedisBetterConfigImpl wxMaDefaultConfig = new WxMaRedisBetterConfigImpl(redisTemplateWxRedisOps, "sweet:answer:ZhengzaiAccessToken:");
// WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
wxMaDefaultConfig.setAppid(appletAppidZhengzai);
wxMaDefaultConfig.setSecret(appletSecretZhengzai);
wxMaDefaultConfig.setMsgDataFormat("JSON");
......
......@@ -32,4 +32,5 @@ public class SweetWechatService {
WxMaService wxMaService = wechatMaConfigure.getWxMaService(anum);
return wxMaService.getUserService().getPhoneNoInfo(sessionKey, encryptedData, iv);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment