调整:优化代码
This commit is contained in:
@@ -4,7 +4,6 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.cool.core.util.CoolPluginInvokers;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
@@ -12,22 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class WxService {
|
||||
private WxMaService wxMaService;
|
||||
|
||||
private WxMpService wxMpService;
|
||||
public WxMaService getWxMaService() {
|
||||
if (ObjUtil.isNotEmpty(wxMaService)) {
|
||||
return wxMaService;
|
||||
}
|
||||
wxMaService = (WxMaService)CoolPluginInvokers.invoke("wx", "getWxMaService");
|
||||
return wxMaService;
|
||||
return (WxMaService)CoolPluginInvokers.invoke("wx", "getWxMaService");
|
||||
}
|
||||
public WxMpService getWxMpService() {
|
||||
if (ObjUtil.isNotEmpty(wxMpService)) {
|
||||
return wxMpService;
|
||||
}
|
||||
wxMpService = (WxMpService)CoolPluginInvokers.invoke("wx", "getWxMpService");
|
||||
return wxMpService;
|
||||
return (WxMpService)CoolPluginInvokers.invoke("wx", "getWxMpService");
|
||||
}
|
||||
|
||||
public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException {
|
||||
|
||||
Reference in New Issue
Block a user