|
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.xml.soap.SAAJResult;
|
|
|
import java.io.IOException;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Component
|
|
@@ -38,6 +39,9 @@ public class UrlData {
|
|
|
|
|
|
public static String VacationToken="";
|
|
|
|
|
|
+ public static String H5Token="";
|
|
|
+
|
|
|
+
|
|
|
private static Gson gson = new Gson();
|
|
|
|
|
|
public String getCorpid() {
|
|
@@ -65,7 +69,7 @@ public class UrlData {
|
|
|
*/
|
|
|
public static void getToken() throws IOException {
|
|
|
UrlData uData = new UrlData();
|
|
|
- uData.setGet_Token_Url("wwd372e7740b9b586f","LBe5M9E8M2y1IOSB5rLAlSbW6etVnPXJSCx0X5i9l8Q");
|
|
|
+ uData.setGet_Token_Url("ww7c43b4b5f33945ad","Vo2f_3pqagj5GRMRun53BOuwgRGOfzYE77A0dMPsFv4");
|
|
|
String resp = toAuth(uData.getGet_Token_Url());
|
|
|
Map<String, Object> map = gson.fromJson(resp,
|
|
|
new TypeToken<Map<String, Object>>() {
|
|
@@ -76,7 +80,7 @@ public class UrlData {
|
|
|
//考勤token
|
|
|
public static void getSignToken() throws IOException {
|
|
|
UrlData uData = new UrlData();
|
|
|
- uData.setGet_Token_Url("wwd372e7740b9b586f","PBLuEss-arZGOAEjVj9G9wwprYLF4gejgJ1EcYI659I");
|
|
|
+ uData.setGet_Token_Url("ww7c43b4b5f33945ad","P3QktVVPme-fpjGr6gmOV_Sig4yHGX05woeFLIChBfo");
|
|
|
String resp = toAuth(uData.getGet_Token_Url());
|
|
|
Map<String, Object> map = gson.fromJson(resp,
|
|
|
new TypeToken<Map<String, Object>>() {
|
|
@@ -86,15 +90,33 @@ public class UrlData {
|
|
|
//假期token
|
|
|
public static void getVacationToken() throws IOException {
|
|
|
UrlData uData = new UrlData();
|
|
|
- uData.setGet_Token_Url("wwd372e7740b9b586f","zYJoGDlBQUroYvHtsqPybXOJseUpkaHFkW-_9UGzNNA");
|
|
|
+ uData.setGet_Token_Url("ww7c43b4b5f33945ad","_naeF4ydxDAl8QKE67WRECArZWNWQZj1c9eXHKkdn0Q");
|
|
|
String resp = toAuth(uData.getGet_Token_Url());
|
|
|
Map<String, Object> map = gson.fromJson(resp,
|
|
|
new TypeToken<Map<String, Object>>() {
|
|
|
}.getType());
|
|
|
VacationToken= map.get("access_token").toString();
|
|
|
}
|
|
|
+
|
|
|
+ public static String code(){
|
|
|
+ String urls= URLEncoder.encode("https://zdd.g.dr1997.com/#/pages/login/login");
|
|
|
+ String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri="+urls+"&response_type=code&scope=snsapi_userinfo&agentid=1000003&state=STATE#wechat_redirect";
|
|
|
+ return url;
|
|
|
+ }
|
|
|
+
|
|
|
+ //h5token
|
|
|
+ public static void getH5Token() throws IOException {
|
|
|
+ UrlData uData = new UrlData();
|
|
|
+ uData.setGet_Token_Url("wwd372e7740b9b586f","l58FcELMPA455cnZ7DPygzFXjZEfploDnOa3vazFakE");
|
|
|
+ String resp = toAuth(uData.getGet_Token_Url());
|
|
|
+ Map<String, Object> map = gson.fromJson(resp,
|
|
|
+ new TypeToken<Map<String, Object>>() {
|
|
|
+ }.getType());
|
|
|
+ H5Token= map.get("access_token").toString();
|
|
|
+ }
|
|
|
+
|
|
|
//获取返回的结果集并把access_token取出来
|
|
|
- protected static String toAuth(String Get_Token_Url) throws IOException {
|
|
|
+ public static String toAuth(String Get_Token_Url) throws IOException {
|
|
|
CloseableHttpClient aDefault = HttpClients.createDefault();
|
|
|
HttpGet httpGet = new HttpGet(Get_Token_Url);
|
|
|
CloseableHttpResponse response = aDefault.execute(httpGet);
|