|
@@ -59,17 +59,6 @@ import org.springframework.web.client.RestTemplate;
|
|
|
public class SysUserServiceImpl implements ISysUserService
|
|
public class SysUserServiceImpl implements ISysUserService
|
|
|
{
|
|
{
|
|
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
|
|
- @Value("${weixin.appid}")
|
|
|
|
|
- private String appid;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${weixin.secret}")
|
|
|
|
|
- private String secret;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${weixin.token-expire}")
|
|
|
|
|
- private long expire;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${weixin.token-secret}")
|
|
|
|
|
- private String tokenSecret;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
private RestTemplate restTemplate;
|
|
@@ -97,8 +86,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
protected Validator validator;
|
|
protected Validator validator;
|
|
|
- @Autowired
|
|
|
|
|
- private RedisService redisService;
|
|
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
@@ -596,8 +584,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
try {
|
|
try {
|
|
|
// 调用微信接口获取openid
|
|
// 调用微信接口获取openid
|
|
|
String url = "https://api.weixin.qq.com/sns/jscode2session?" +
|
|
String url = "https://api.weixin.qq.com/sns/jscode2session?" +
|
|
|
- "appid=" + appid + "&" +
|
|
|
|
|
- "secret=" + secret + "&" +
|
|
|
|
|
|
|
+ "appid=" + "wxc738cddfb96a9176" + "&" +
|
|
|
|
|
+ "secret=" + "3fb1122e5b811ec55272d84d203983b9" + "&" +
|
|
|
"js_code=" + loginBody.getCode() + "&" +
|
|
"js_code=" + loginBody.getCode() + "&" +
|
|
|
"grant_type=authorization_code";
|
|
"grant_type=authorization_code";
|
|
|
String result = restTemplate.getForObject(url, String.class);
|
|
String result = restTemplate.getForObject(url, String.class);
|