Browse Source

Merge remote-tracking branch 'origin/master_jiaoyang' into master_jiaoyang

syh 5 years ago
parent
commit
356aab63ae

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -64,6 +64,8 @@ public class CallbackController {
                         HttpServletResponse response,
                         @RequestParam("code") String code,
                         @RequestParam("state") String state) throws IOException {
+        System.err.println("code:" + code);
+        System.err.println("state:" + state);
         response.sendRedirect(state + "?code=" + code);
     }
 

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -160,11 +160,11 @@ public class LoginController {
     public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code) throws Exception {
         Result<JSONObject> result = new Result<>();
         val configStorage = new WxCpDefaultConfigImpl();
-        configStorage.setCorpId("ww24b8a47826f5875f");
+        configStorage.setCorpId("wwef2e51064c0ac897");
         configStorage.setAgentId(1000002);
-        configStorage.setCorpSecret("MJIlySADGPlgvADnkFQPUpfZD4yV-4WN6066OgNnb0s");
-        configStorage.setToken("hcst2019");
-        configStorage.setAesKey("hcst2019");
+        configStorage.setCorpSecret("ieoVDAIurCOMdLrvktyQNCqWvTPqdphmXSFdk57NZ1k");
+       /* configStorage.setToken("hcst2019");
+        configStorage.setAesKey("hcst2019");*/
         val service = new WxCpServiceImpl();
 
         service.setWxCpConfigStorage(configStorage);

+ 7 - 19
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java

@@ -61,24 +61,14 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
     @Override
     public String getKuaishouCodeUrl(String state, Integer agentType) throws UnsupportedEncodingException {
         StringBuffer sb = new StringBuffer();
-        if (agentType == 1) {
-            sb.append(PropertiesUtils.getValue("kuaishou_config", "kuaishou_auth_url"))
-                    .append(KuaishouInterfaceConstant.AUTH_PATH)
-                    .append("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_appid"))
-                    .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
-                    .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D")
-                    .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));
-        } else if (agentType == 0) {
 
-            // &scope=%5B%22ad_query%22%2C%22ad_manage%22%5D&
-            // &scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D
-            sb.append(PropertiesUtils.getValue("kuaishou_config", "kuaishou_auth_url"))
-                    .append(KuaishouInterfaceConstant.AUTH_PATH)
-                    .append ("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_appid"))
-                    .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
-                    .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D")
-                    .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));
-        }
+        sb.append(PropertiesUtils.getValue("kuaishou_config", "kuaishou_auth_url"))
+                .append(KuaishouInterfaceConstant.AUTH_PATH)
+                .append("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_appid"))
+                .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
+                .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22ad_manage%22%5D")
+                .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));
+
 
         return sb.toString();
     }
@@ -86,8 +76,6 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
     @Override
     public String getByteDanceCodeUrl(String state) throws UnsupportedEncodingException {
         StringBuffer sb = new StringBuffer();
-
-
         sb.append(PropertiesUtils.getValue("bytedance_config", "bytedance_auth_url"))
                 .append(BytedanceInterfaceConstant.AUTH_PATH)
                 .append("?app_id=" + PropertiesUtils.getValue("bytedance_config", "bytedance_appid"))

+ 0 - 4
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -64,7 +64,6 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         param.put("grant_type", "refresh_token");
         param.put("refresh_token", token.getRefreshToken());
         String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
-        System.err.println(JSONObject.parseObject(result));
         XxlJobLogger.log("头条刷新token;accountId:{},返回信息:{}", token.getAccountId(), result);
         if (null == result || result.trim().equals("") || result.equalsIgnoreCase("null")) {
             XxlJobLogger.log("头条刷新token失败;accountId:{},返回信息:{}", token.getAccountId(), result);
@@ -121,9 +120,6 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         if (agentType == 1) {
             param.put("app_id", PropertiesUtils.getConfig("kuaishou_appid"));
             param.put("secret", PropertiesUtils.getConfig("kuaishou_secret"));
-        } else if (agentType == 0) {
-            param.put("app_id", PropertiesUtils.getConfig("kuaishou_third_appid"));
-            param.put("secret", PropertiesUtils.getConfig("kuaishou_third_secret"));
         }
 
         param.put("refresh_token", refreshToken);

+ 3 - 5
module-kuaishou/src/main/resources/kuaishou_config.properties

@@ -1,11 +1,9 @@
 kuaishou_api_url=https://ad.e.kuaishou.com
 kuaishou_auth_url=https://ad.e.kuaishou.com
-kuaishou_appid=27
-kuaishou_third_appid=328
+kuaishou_appid=328
 oauth_type=agent
-kuaishou_secret=QovprB1tNhXptgDc
-kuaishou_third_secret=1iFTBiMdohkyEQQs
-kuaishou_callback_url=http://adsp.c-top.com.cn:8080/jeecg-boot/kuaishou
+kuaishou_secret=1iFTBiMdohkyEQQs
+kuaishou_callback_url=http://callback.shyouteng.com.cn/kuaishou
 apk_sava_path=/mnt/file/apk
 image_sava_path=/mnt/file/image
 video_sava_path=/mnt/file/video