From 1d817903baef6106a59e60c421cdf18e925091c4 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sun, 10 Apr 2022 20:46:35 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E6=8A=A5=E5=A5=87=E6=80=AA=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/api/impl/BaseWxMpServiceImpl.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java index d11499bd4..e12e30493 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java @@ -25,11 +25,7 @@ import me.chanjar.weixin.common.session.WxSessionManager; import me.chanjar.weixin.common.util.DataUtils; import me.chanjar.weixin.common.util.RandomUtils; import me.chanjar.weixin.common.util.crypto.SHA1; -import me.chanjar.weixin.common.util.http.RequestExecutor; -import me.chanjar.weixin.common.util.http.RequestHttp; -import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; -import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor; -import me.chanjar.weixin.common.util.http.URIUtil; +import me.chanjar.weixin.common.util.http.*; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.mp.api.*; @@ -46,16 +42,7 @@ import java.io.IOException; import java.util.Map; import java.util.concurrent.locks.Lock; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.CLEAR_QUOTA_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.FETCH_SHORTEN_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.GEN_SHORTEN_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.GET_CALLBACK_IP_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.GET_CURRENT_AUTOREPLY_INFO_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.GET_TICKET_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.NETCHECK_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.QRCONNECT_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.SEMANTIC_SEMPROXY_SEARCH_URL; -import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.SHORTURL_API_URL; +import static me.chanjar.weixin.mp.enums.WxMpApiUrl.Other.*; /** * 基础实现类. @@ -482,6 +469,10 @@ public abstract class BaseWxMpServiceImpl implements WxMpService, RequestH @Override public void setWxMpConfigStorage(WxMpConfigStorage wxConfigProvider) { final String defaultMpId = wxConfigProvider.getAppId(); + if (defaultMpId == null) { + throw new WxRuntimeException("appid不能设置为null"); + } + this.setMultiConfigStorages(ImmutableMap.of(defaultMpId, wxConfigProvider), defaultMpId); }