Search in sources :

Example 1 with LoginResultDTO

use of com.thatday.user.modules.user.dto.LoginResultDTO in project spring-cloud-alibaba by longlylong.

the class WxMaUserController method getCommonLoginResult.

private Result<LoginResultDTO> getCommonLoginResult(@RequestBody @Valid CommonLoginVo vo, String appId) {
    try {
        WxMaService wxMaService = WxMaConfiguration.getMaService(appId);
        WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(vo.getCode());
        String openId = session.getOpenid();
        Result<LoginResultDTO> token = null;
        return token;
    } catch (WxErrorException e) {
        throw TDExceptionHandler.throwGlobalException("getCommonLoginResult", e);
    }
}
Also used : LoginResultDTO(com.thatday.user.modules.user.dto.LoginResultDTO) WxMaService(cn.binarywang.wx.miniapp.api.WxMaService) WxMaJscode2SessionResult(cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult) WxErrorException(me.chanjar.weixin.common.error.WxErrorException)

Aggregations

WxMaService (cn.binarywang.wx.miniapp.api.WxMaService)1 WxMaJscode2SessionResult (cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult)1 LoginResultDTO (com.thatday.user.modules.user.dto.LoginResultDTO)1 WxErrorException (me.chanjar.weixin.common.error.WxErrorException)1