Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

zoujiajian vor 3 Jahren
Ursprung
Commit
179f4ff7b8

+ 1 - 6
netflix-service/src/main/java/com/cyksj/service/advertisement/impl/AdvertisementOrderDonServiceImpl.java

@@ -53,9 +53,6 @@ public class AdvertisementOrderDonServiceImpl extends ServiceImpl<AdvertisementO
     @Value("${advertisement.shopKey}")
     private String shopKey;
 
-    @Value("${advertisement.appId}")
-    private String appId;
-
     @Value("${advertisement.shopId}")
     private String shopId;
 
@@ -74,9 +71,7 @@ public class AdvertisementOrderDonServiceImpl extends ServiceImpl<AdvertisementO
 
     @Override
     public H5JsPayParams pay(Long popularizeId, BigDecimal money, String appId, AdvertisementUser user, AdvertisementOrderDon.Source source, String callback, String callbackType) throws Exception {
-        if(!this.appId.equals(appId)){
-            throw BusinessRuntimeException.getInstance("appId非法.");
-        }
+
         AdvertisementPopularize popularize = popularizeMapper.selectById(popularizeId);
         if (popularize == null) {
             log.error("链接不存在:{}", popularizeId);

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/advertisement/AdvertisementUserController.java

@@ -101,7 +101,7 @@ public class AdvertisementUserController {
         AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId);
         String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
 
-        response.sendRedirect(weChatService.createUrl(state, notify + WeChatAuthRedirectUrl.get(authType).getUrl(), appId, WeChatAuthRedirectUrl.get(authType).getScope() ));
+        response.sendRedirect(weChatService.createUrl(state, notify + "/applets/advertisement/user/weChat/silentRedirect", appId, WeChatAuthRedirectUrl.get(authType).getScope() ));
 
     }
 

+ 3 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -51,6 +51,7 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
+import java.util.Optional;
 
 /**
  * @author chan
@@ -159,11 +160,11 @@ public class AuthorizationController {
      * 微信js-sdk 权限验证
      */
     @RequestMapping(value = "/jsTicket", method = RequestMethod.GET)
-    public Result<JsSdkTicket> ticket(String url) throws Exception{
+    public Result<JsSdkTicket> ticket(String appId, String url) throws Exception{
         if (StringUtils.isBlank(url)) {
             throw BusinessRuntimeException.getInstance("请输入授权网址.");
         }
-        return GatewayResponse.SUCCESS.newBuilder().toResult(authorizationService.getJsTicket(weChatConfig.getAppid(),url));
+        return GatewayResponse.SUCCESS.newBuilder().toResult(authorizationService.getJsTicket(Optional.ofNullable(appId).orElse(weChatConfig.getAppid()),url));
 
     }