소스 검색

fix: 修复middle更新微信平台授权信息未同步子服务问题

hidewnd 2 일 전
부모
커밋
7dda334edf

+ 4 - 1
yt-middle/middle-platform/src/main/java/com/ytpm/middle/service/impl/AppServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ytpm.middle.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -164,13 +165,15 @@ public class AppServiceImpl implements AppService {
         config.setTakuNativePid(app.getTakuNativePid());
         config.setTakuRewardPid(app.getTakuRewardPid());
         config.setTakuInterstitialPid(app.getTakuInterstitialPid());
+        config.setOpenId(app.getWxAppId());
+        config.setSecret(app.getWxSecret());
         // 忽略异常 旧服务兼容性处理
         ExecutorService executor = Executors.newCachedThreadPool();
         try {
             executor.execute(() -> {
-                List<String> apps = apkMapper.getAppListForSuperior(app.getAppId());
                 AppConfigUpdateParam param = new AppConfigUpdateParam();
                 param.setDefaultConfig(config);
+                List<String> apps = apkMapper.getAppListForSuperior(app.getAppId());
                 param.setApps(apps);
                 feignInvoker.invoke(old.getServiceName(), "updateAppsConfig", param);
             });

+ 7 - 0
yt-question/yt-question-service/src/main/java/com/ytpm/question/controller/WxController.java

@@ -203,6 +203,13 @@ public class WxController {
                 if(StrUtil.isNotEmpty(updateInfo.getTakuInterstitialPid())) {
                     appConfig.setTakuInterstitialPid(updateInfo.getTakuInterstitialPid());
                 }
+                // 更新微信openId信息
+                if (StrUtil.isNotEmpty(updateInfo.getSecret())) {
+                    appConfig.setSecret(updateInfo.getSecret());
+                }
+                if (StrUtil.isNotEmpty(updateInfo.getOpenId())) {
+                    appConfig.setOpenId(updateInfo.getOpenId());
+                }
                 appUserMapper.updateAppConfig(appConfig);
             }
         }