|
@@ -3,6 +3,7 @@ package com.xjrsoft.common.utils;
|
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatDepartDto;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatUserDto;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -41,7 +42,8 @@ public class WeChatUtil {
|
|
|
String result = HttpUtil.get("https://api.weixin.qq.com/sns/oauth2/access_token", paramMap);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
if (jsonObject.containsKey("errcode")) {
|
|
|
- return null;
|
|
|
+ throw new MyException(result);
|
|
|
+ //return null;
|
|
|
}
|
|
|
String openId = jsonObject.get("openid").toString();
|
|
|
return openId;
|